searching on a subform

  • Thread starter Thread starter Tom Gruett
  • Start date Start date
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?
 
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
 
Back
Top