Main Board > Nomads

Pass an argument to a grid cell query

(1/1)

Rob:
How do I pass an argument to a query which is attached to a grid cell?

Version 2020

Mike King:
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.

Rob:
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.

Navigation

[0] Message Index

Go to full version