searching on a subform

T

Tom Gruett

I have a database used to manage several parking lots. I
have a table set up for employee information, and a
related table for their license plate numbers. (Most have
more than one car). On the main form, I have the
employee information, with the plate numbers shown on a
subform. I need to be able to search the database by
plate number. This is proving difficult because the plate
info is in the subform, not the main form. Does anyone
know how to do a search from a subform?
 
R

Rick Brandt

Tom Gruett said:
I have a database used to manage several parking lots. I
have a table set up for employee information, and a
related table for their license plate numbers. (Most have
more than one car). On the main form, I have the
employee information, with the plate numbers shown on a
subform. I need to be able to search the database by
plate number. This is proving difficult because the plate
info is in the subform, not the main form. Does anyone
know how to do a search from a subform?

You need to apply a filter with a subquery in its WHERE clause.

Me.Filter = "EmployeeID In(SELECT EmployeeID " & _
"FROM LicensePlates " & _
"WHERE LicensePlate = 'SomeValue')"
Me.FilterOn = True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top