Combo box help

G

Guest

I am using a combo box to find records in a form, what do I have to use to
find records in a form this is already filtered by one field and would like
to find another filter by selecting it in the Combo box. Example: I have
voters filtered by streets in a query, the source for this form is that
query. I would like to place a combo box
and show a certain party that voters on this form belong to, I already have
reports to this effect, but would like to use this form to do the same task.
Thanks in Advance.
 
K

Ken Snell [MVP]

How is the form set up now? Does the query that is the form's RecordSource
use the first combo box as a parameter? or are you using the Filter property
of the form based on the selection made in the first combo box?

Tell us more details about your current form's setup.
 
G

Guest

Please bear with me I’ll try to explain. I have a query with voter’s names
street numbers street names and other info. In the query I have that filtered
by street names. The form is resourced to this query. On the form I want a
combo box that will find the party the voters on this particular street
belong to. What I would like this to do, is if there is 56 voters on this
street and 10 are independents, use the combo box to select IND in the combo
box, and show just the 10 voters that are independents. (the total records
 
K

Ken Snell [MVP]

OK -

What you can do is put this combobox in the form's header. Then put this
code on its AfterUpdate event (code assumes that the combo box will contain
a string value that is the value in the political party field):

Private Sub ComboBoxName_AfterUpdate()
Me.FilterOn = False
If Len(Me.ComboBoxName.Value & "") > 0 Then
Me.Filter = "[PoliticalPartyFieldName]='& " Me.ComboBoxName.Value & "'"
Me.FilterOn = True
End If
End Sub

--

Ken Snell
<MS ACCESS MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Button and Combo Box 3
Form -> Combo to a SubForm 3
Combo box headache 5
Combo Box Problem 5
Combo Box Filter 1
Combo Box Display 3
combo box display result 6
Filter tabular form by combo box 0

Top