Basic recipe for a filter form:
- Filtering main form: SELECT * FROM “Criteria” WHERE “ID” = 0 selects only one distinct row from the criteria table.
- Form properties: Disallow everything except modification of data. This way the user can not tab into anyrecord other than the specified one. And you do not need a navigation bar while editing this single record.
- You can re-use the same criteria table for other forms if your primary key is some integer (not auto-integer).
- Based on Robert’s suggestion, you get case-insensitive matches with the help of function Lower():
SELECT "Name", "Vorname", "Ort"
FROM "Kunden" "c", "FilterKunden" "f"
WHERE Lower("c"."Name") LIKE Lower("f"."Name") || '%' OR "f"."Name" IS NULL
Alternatively, you could switch the column types to VARCHAR_IGNORECASE.
This 2-table row set is not editable. If you want an editable filtered row set, create a subform based on a parameter query including a single table with its primary key (simply select all columns):
SELECT * FROM "Kunden"
WHERE Lower("Name") LIKE Lower(:BeginsWith) || '%' OR :BeginsWith IS NULL
:BeginsWith is a named parameter. Link the subform’s slave field to BeginsWith (without leading colon) and the master field to the corresponding column of the filtering parent form.