Query with combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two tables 'Company Names' and 'Orders' linked by the Company Name (Primary Key). Within one of my forms the company name and extention number field have been produced as Combo Boxes, allowing me to select a Company name and the extention number will automatically appear. When I try to produce an Orders Query, using the Company Name it displays the Company name as the ID number and not the actual company name.

How can I get the query to display the Company Name and not the ID Number
 
In the combo box, set the Column Widths property to something like this ( in
order to make the first column not visible ):
0"; 2"

This assumes that your query is returning both the ID number and the company
name as the row source query for the combo box.

--
Ken Snell
<MS ACCESS MVP>

Karen said:
I have two tables 'Company Names' and 'Orders' linked by the Company Name
(Primary Key). Within one of my forms the company name and extention number
field have been produced as Combo Boxes, allowing me to select a Company
name and the extention number will automatically appear. When I try to
produce an Orders Query, using the Company Name it displays the Company name
as the ID number and not the actual company name.
 
Post the SQL of the row source query for the combo box that is giving you
problems.

Also, you don't by any chance have a lookup field set in the table for the
CompanyID field, do you?
 
The problem is that your "Dropdown" field is storing the number and linking to
some other table containing the actual text.

This "feature" of Access hides data in the tables and eventually you run into
this problem.

Do you know which table actually contains the company name? If so, you will
have to include it in your query and set a link between it and your table.
 
Back
Top