Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Filter Question
Thu, Aug 3 2017 6:28 AMPermanent Link

Michael Saunders

Can I use variables determined at runtime in a filter expression  either as the filter property or by using the OnfilterRecord event  The examples I have seen all seem to require literal values eg

'City = ' + QuotedStr('Manchester');

but I want to do something like this
'City = ' + QuotedStr(table.fieldByName('City').asstring);

Thanks

Mike
Thu, Aug 3 2017 7:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Michael


You can do it in the OnFilterRecord if you can figure out the appropriate code. There's no built in facility though.

The nearest you can get is to use queries or a master-detail relationship

Roy Lambert
Thu, Aug 3 2017 10:36 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< Can I use variables determined at runtime in a filter expression  either as the filter property or by using the OnfilterRecord event  The examples I have seen all seem to require literal values eg

'City = ' + QuotedStr('Manchester');

but I want to do something like this
'City = ' + QuotedStr(table.fieldByName('City').asstring); >>

You can do the latter, but, as you show, you have to construct the filter expression in code.  Filters don't really need parameters like SQL because there isn't really much to the parsing/preparation phase.

Tim Young
Elevate Software
www.elevatesoft.com
Image