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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I search record based on 3 parameters?

Status
Not open for further replies.

Taecca

Technical User
Jul 20, 2004
59
US
In my table I have records with :Section ID, Sub Section ID, Item Id and LocationName

I need to do a search on my form where a user would use combo boxes to indicate Section, SubSection, Item and finally LocationName to retrieve the correct record.

How someone guide me?

Thank you
 
have a look at
thread702-563930

Hope this helps
Hymn
 
Something like....

Me.Filter = "SectionID = '" & me.cboSectionID & "' and SubSection = '" & me.cboSubSection & "' and ItemID = '" & me.cboItem & "' and LocationID = '" & me.cboLocation & "'"
Me.FilterOn = True

Remove the single quotes for any numerical fields...
Me.Filter = "SectionID = " & me.cboSectionID & " and Subsection = " & me.cboSubSection & " and ItemID = " & me.cboItem & " and LocationID = " & me.cboLocation


Randy
 
This FAQ faq181-5497 contains a function that will build the filter for you. It works for listboxes, textboxes, option groups, check boxes, and ranges (i.e. date ranges). You only have to do 3 things to make it work.

1. Create a new module and copy the function from the FAQ and paste it into you new module.
2. Define your tag properties as described in the FAQ
3. Insert the following code:
Me.Filter = BuildWhere (Me)
Me.FilterOn = True

The BuildWhere function can also be used in conjunction with a Report Criteria form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top