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

SEARCHING USING COMBO BOXES

Status
Not open for further replies.

philipmck

Technical User
Jul 30, 2008
21
EU
I HAVE A FORM WITH 3 COMBO BOXES - PROCESS , OPTION1COMBO AND OPTION2 COMBO. I ALREADY HAVE IT THAT IF YOU SELECT AND OPTION IN PROCESS IN CHANGES WHAT APPEARS IN OPTION 1 ETC ETC BUT WHAT I WANT TO KNOW HOW TO DO IS HOW CAN I GET IT THAT THE "SEARCH" BUTTON WILL TAKE THE INFORMATION SELECTED FROM THE 3 COMBO BOXES AND THEN SEARCH THE DATABASE AND BRING BACK THE NECESSARY RESULTS?
 
Please, don't SHOUT.
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Please do not use upper case, it is usually seen as 'shouting' and is not polite.

When you say 'bring back the results' what do you want to happen? Open a new form? Show only matching records in the current form or subform? And so on.
 
Basically i have a database window showing in the form. At the start all of the records are showing then once a search is completed it just shows the results.

And apologies but i didnt mean to shout.
 
By database window, do you mean a subform? You can:

* Change the RecordSource of the subform via code.
[tt]Hint
Me.[Name of Subform Control].Form.RecordSource="SELECT ThisText, That, Etc FROM tblSomeTable WHERE ThisText LIKE '" & Me.cboThis & "*'"[/tt]
* Set a filter on the subform via code
[tt]Hint
Me.[Name of Subform Control].Form.Filter="ThisText='" & Me.cboThis & "'"
Me.[Name of Subform Control].Form.FilterOn=True[/tt]
* Set Link Child and Link Master fields either via code or in form design.
 
I have the database on the form. That works perfect:

Private Sub Form_Load()
'Me.Child27 = Data
End Sub

What i need the code for is to get the SEARCH button to take 3 pieces of information from 3 combo boxes and then search the database with the selected information

ps thanks for your help
 
You say above:
At the start all of the records are showing then once a search is completed it just shows the results.

This is not a search, it is a filter or some other adjustment of the recordset. Have a look at filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top