Combo box

  • Thread starter Thread starter Courtney
  • Start date Start date
C

Courtney

I have a table that I call Contact Information with the
following fields on it:
Account Number
Contact First Name 1
Contact Last Name 1
Contact 1 Address
Contact 1 City
Contact 1 State
Contact 1 Zip
Contact 1 County
Contact First Name 2
Contact Last Name 2
Contact 2 Address
Contact 2 City
Contact 2 State
Contact 2 Zip
Contact 2 County

This table is linked to another table that contains order
information. The relationship is based on the Account
Number.

I created a form based off of the order table. In this
form, I have a field called contact name that I have
designed as a combo box. When the user types the account
number in the formand goes to select a contact name from
the combo box, I want it to display both contact name 1
and combo name 2 associated with that account number as
choices. For example, if I type account number 1234, I
want to click on the drop down box and see Ben Smith and
Jane Smith as options in the drop down. I tried creating
a query and basing the combo box off of that query, but
it just didn't work out right.

Please help.
 
The quey SQL should look something like
"SELECT [Contact First Name 1]& " " & [Contact Last Name 1]
FROM [Contact Information]
WHERE [Account Number] = " & {accountTextBox}.Value & "UNION
SELECT [Contact First Name 2]& " " & [Contact Last Name 2]
FROM [Contact Information]
WHERE [Account Number] = " & {accountTextBox}.Value

Hope That Helps
Gerald Stanley MCSD
 
Back
Top