Searching using combo box

pmckeown

New member
Local time
Today, 04:28
Joined
Feb 10, 2009
Messages
6
I have a combo box with 6 counties in it.

These counties come from a table called 'cboCounty'. I then have a table which has got a long list of businesses with information relating to them.

What I want is that when i select from the drop down list for example 'antrim', that all of the businesses from antrim would appear and I could scroll through them ie at the bottom of the form the bar would show 'Record 15 of 15' for example.

Anyone got any ideas?
 
Assuming that the combo box is unbound and in the form's header:

Set the form's record source to have this criteria:

Where [CountyField] Like forms![YourFormName].[YouComboBoxName]

In the after update event of the combo box place this code int he [Event Procedure]

Me.Requery


Note:
the "cbo" prefix is generally used for combo box controls, not tables. it is started to name tables with the "tbl" prefix.
 
Ok, I have got this part of the record source complete:

Code:
......Like forms![SearchForm].[cboFindLocation]

but the
Code:
Where [tblProcess]
part I am not sure about.

The table the list is coming from is called 'tblProcess' so is this what I need in the []?

Thanks for help so far.
 
Ok, I have got this part of the record source complete:

Code:
......Like forms![SearchForm].[cboFindLocation]

but the
Code:
Where [tblProcess]
part I am not sure about.

The table the list is coming from is called 'tblProcess' so is this what I need in the []?

Thanks for help so far.

If you use the query designer, it will make this very easy.

If you want to manually write the SQL (I rarely do if I can use teh Query Designer)


Code:
... Where [tblProcess].[[B]YourFiedlNameHere[/B]] Like forms![SearchForm].[cboFindLocation]
[/CODE]
 

Users who are viewing this thread

Back
Top Bottom