PxPlus User Forum

Main Board => Discussions => Nomads => Topic started by: Rob on December 15, 2022, 03:47:11 PM

Title: Pass an argument to a grid cell query
Post by: Rob on December 15, 2022, 03:47:11 PM
How do I pass an argument to a query which is attached to a grid cell?

Version 2020
Title: Re: Pass an argument to a grid cell query
Post by: Mike King on December 15, 2022, 06:37:12 PM
The easiest way is by using global variables, but a lot depends on exactly what you are trying to do.  If you are looking to pass additional information from other grid cells to the Query you might want to create a query program that can pull the data from the other cells in the grid and transfer that to the query which it could call.
Title: Re: Pass an argument to a grid cell query
Post by: Rob on December 16, 2022, 11:48:27 AM
I wanted to limit what shows up in the query based on the value of another column.

That other column only has 2 valid values so I ended up creating two queries and put a different fixed Key Prefix in each.

I read the value of the other column when the query cell gets focus and place the name of the appropriate query in a string variable.

The Preset Value/Expression for the query cell is just equal to the string variable.


I'm surprised that there isn't some easy way to pass an argument to the query. Maybe in Celltag$? I would think that this comes up fairly often.