I have a listbox on my search form that lets me search the table Patients
using text criteria for firstname
, lastname
, ID
and othernames
. the SQL for the search Query:
SELECT
Patients.[Patient ID],
Patients.[First Name],
Patients.[Last Name],
Patients.[Other Names],
Patients.Gender
FROM Patients
WHERE (((Patients.[Patient ID]) Like "*" & [Forms]![SearchTab]![txtI] & "*")
AND ((Patients.[Last Name]) Like "*" & [Forms]![SearchTab]![txtL] & "*")
AND ((Patients.[Other Names]) Like "*" & [Forms]![SearchTab]![txtO] & "*")
AND ((Patients.[First Name]) Like "*" & [Forms]![SearchTab]![txtF] & "*"))
ORDER BY
Patients.[Last Name],
Patients.[First Name];
Search works fine but there is another form for data entry into the Patients
table and none of the new entries are being found by the search form, but I can see them in the table.
Anyone can shed some light on the problem?
Try replacing this: [Forms]![SearchTab]![txtI]
With this: Nz([Forms]![SearchTab]![txtI])
For all 4 of your text search boxes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.