Assign a query to a cell at run time.

Started by dlocke, March 17, 2023, 10:15:21 AM

Previous topic - Next topic

dlocke

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

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

#2
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.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

dlocke

Thanks,
I have created the query in the presets and updated the code with work with it.

Don.