I would like to create a Base form with the following basic layout:
- A text box in which the user can enter a search term (could also be a combo box with predefined values)
- A grid control which shows matching records, i.e. where a particular column begins with the search term
The approach I have in mind is:
- The data source for the form is the table holding the records to show in the grid.
- The text box is not bound to a data field.
- Search is implemented through filtering, equivalent to something like
WHERE "someTable"."someColumn" LIKE ("textBoxValue" + '%')
If the text box is empty, either everything or nothing can match—this is not really important.
Of course I could create a macro that sets the appropriate filter on the form whenever the contents of the text box change.
However, I was wondering if there is a simpler way to achieve this, i.e. without macros. Can I reference the contents of the text box in the filter expression? How? Will changes to the text box be reflected immediately?