Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filters in a form

Status
Not open for further replies.

hansproperty

Technical User
Feb 14, 2003
4
0
0
GB
I am trying to locate a record in a table using a set of three filters, the first one for a component type, the second for a model number, and the third needs to bring up a set of serial numbers based on the results of the previous filters. I have tried using combo boxes for the three filters, but they need to be unbound to prevent the records being altered. The problem is how do I select a record which is a function of Type, Model and SerialNo from three unbound combo boxes? It would be easy if the SerialNo was unique, but unfortunately many models have identical Serial numbers.
 
In the afterupdate event of each of the comboboxes, put code similar to the following:

Code:
Dim strFilter As String

strFilter = Me.Filter ' record the filter details
' must edit line below to reflect data type, combo name and field name
strFilter = strFilter & " AND TYPE = '" & Me!cboType & "'"

Me.Filter = Mid(strFilter, 6) ' set filter to everything after character 6 (ie extract the AND 
Me.FilterOn = True ' and apply it.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top