PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Assign a query to a cell at run time.  (Read 507 times)

dlocke

  • Member
  • **
  • Posts: 17
    • View Profile
Assign a query to a cell at run time.
« on: March 17, 2023, 10:15:21 AM »
Hi

Can you assign a query to a cell at run time ?
I see a "query" property in the manual but I can an error 88 trying to access it.

Don Locke.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Assign a query to a cell at run time.
« Reply #1 on: March 17, 2023, 10:51:37 AM »
Technically the Query property doesn't exist (at least in Nomads -- in iNomads there is a property called CellQuery$ which you can alter dynamically).  What Nomads does is maintain internal tables relative to the grid column/row with the query setting.

There really isn't a way to dynamically change this table but what we would suggest is assign a query that runs a program and in that program you can decide which actual query you want to run and should your logic decide there isn't a query, display an error message.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jane Raymond

  • Staff
  • Diamond Member
  • *****
  • Posts: 280
    • View Profile
    • PVX Plus Technologies
Re: Assign a query to a cell at run time.
« Reply #2 on: March 20, 2023, 08:44:28 AM »
One thing I have done at run time is programmatically assign a 'celltype$ (such as Lookup, LookupHideBtn, Query, QueryHideBtn) to a grid cell. Then in the cell logic you can test for _EOM$=$FF$ to determine if the query or lookup button has been pressed and then do logic to invoke the query.
« Last Edit: March 20, 2023, 09:34:20 AM by Devon Austen »
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

dlocke

  • Member
  • **
  • Posts: 17
    • View Profile
Re: Assign a query to a cell at run time.
« Reply #3 on: March 20, 2023, 09:17:32 AM »
Thanks,
I have created the query in the presets and updated the code with work with it.

Don.