Filter records in Base form based on control

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?

Trying to do the same. Have you found a solution?

I can’t answer for @stanton but you could simply read the suggestion of @UnklDonald to find one. If that doesn’t fit your needs, tell why…

A Filter table can help with that, look here for several examples
https://forum.openoffice.org/en/forum/viewtopic.php?p=152743#p152743

Thanks UnklDonald. I had a look at the examples and the Database “Berlin Streets” does just that. Is working. But when I try to create a query for my situation I get the error “Like can not be used with this field”. But the sample uses “Like” just in that field “criterion”. Have not found out why.

Because you do not compare text?

What is that field? Number? Date?

Cross posted/same question:
https://forum.openoffice.org/en/forum/viewtopic.php?p=548353#p548353