C
Courtney
When I try to run the union query, I get "Syntax error in
string in query expression '[Account Number] ="&
{accountTextBox}.Value'.
Now, I don't know if this is relevant, but I will mention
it anyway. The account number field on Contact Table is
a Combo Box that presents options from a query that was
built off of another table called demographicstable. In
essence, the master list of account numbers is found on
the table called demographicstable, the user then
associates the account number to contacts using the
contact Information table and then the account number is
associated with an order on the Request table.
I thought that if I changed the {accountTextBox} to
{accountComboBox}, it would work, but it didn't.
Please help. I'm desperate. Thanks,
Subject: Re: Combo box
From: "Gerald Stanley" <[email protected]> Sent:
3/9/2004 11:32:57 AM
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
string in query expression '[Account Number] ="&
{accountTextBox}.Value'.
Now, I don't know if this is relevant, but I will mention
it anyway. The account number field on Contact Table is
a Combo Box that presents options from a query that was
built off of another table called demographicstable. In
essence, the master list of account numbers is found on
the table called demographicstable, the user then
associates the account number to contacts using the
contact Information table and then the account number is
associated with an order on the Request table.
I thought that if I changed the {accountTextBox} to
{accountComboBox}, it would work, but it didn't.
Please help. I'm desperate. Thanks,
Subject: Re: Combo box
From: "Gerald Stanley" <[email protected]> Sent:
3/9/2004 11:32:57 AM
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
..-----Original Message-----
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.
.