PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Pass an argument to a grid cell query  (Read 1066 times)

Rob

  • New Member
  • *
  • Posts: 4
    • View Profile
Pass an argument to a grid cell query
« 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

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Pass an argument to a grid cell query
« Reply #1 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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Rob

  • New Member
  • *
  • Posts: 4
    • View Profile
Re: Pass an argument to a grid cell query
« Reply #2 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.