Combo Box in a form

S

schongresh

I have a form that should allow a user to choose two items from a
list. I have two combo boxes that show the list in each box. I am
trying to write the query that will exclude the name that is chosen in
either box, so that there can be no repeated names. In the query
builder, I am trying to exclude the 1st name chosen fromt he other
combo box list by using <>[Helper1] in the criteria box, but this
returns a mismatch. Could someone please show me an example of how to
achieve this on a form?
 
G

Guest

Try the following:

Private Sub Combo1_AfterUpdate()
Combo2.RowSource = "SELECT helper1 FROM [name of your table] WHERE
helper1 <> " & chr(34) & Combo6.Column(0) & chr(34) & "';"
Combo2.Requery
End Sub

Note: chr(34) is actually the " sign.
 

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

Top