Select Distinctrow troubles

opiv6ix

Registered User.
Local time
Today, 02:10
Joined
Jan 13, 2007
Messages
21
This is probably pretty simple, but I'm having difficulty. After setting up my tables, table relationships, and a form, I'm having trouble with drop boxes and SELECT DISTINCTROW.

The main table is for Orders. The other tables are information on Employees, and Buyers and Sellers. The Buyers and Sellers are both on the same table, because the same entries are sometimes used for either.

I'm trying to attach the primary keys for buyer, seller, and employee to each order with a drop box in the form that uses the names of each. The code I'm using is:

rowsource: SELECT DISTINCTROW [Employees].[EmployeeID], [Employees].[EmployeeName] FROM [Employees] ORDER BY [EmployeeName];

For some reason, this works fine for my employee dropbox, but using the same code (changing necessary fields) for my buyers and sellers won't work. It displays the primary keys in the dropbox instead. If I reverse [EmployeeID] and [EmployeeName], the name is displayed, but this isn't helpful because it tries to use the employee name instead of the ID in the table.

Is this because my Buyer/Seller table is much larger, or because it is linked to multiple fields in my Orders? Or is there something else I'm missing?
 
opiv6ix said:
This is probably pretty simple, but I'm having difficulty. After setting up my tables, table relationships, and a form, I'm having trouble with drop boxes and SELECT DISTINCTROW.

The main table is for Orders. The other tables are information on Employees, and Buyers and Sellers. The Buyers and Sellers are both on the same table, because the same entries are sometimes used for either.

I'm trying to attach the primary keys for buyer, seller, and employee to each order with a drop box in the form that uses the names of each. The code I'm using is:

rowsource: SELECT DISTINCTROW [Employees].[EmployeeID], [Employees].[EmployeeName] FROM [Employees] ORDER BY [EmployeeName];

For some reason, this works fine for my employee dropbox, but using the same code (changing necessary fields) for my buyers and sellers won't work. It displays the primary keys in the dropbox instead. If I reverse [EmployeeID] and [EmployeeName], the name is displayed, but this isn't helpful because it tries to use the employee name instead of the ID in the table.

Is this because my Buyer/Seller table is much larger, or because it is linked to multiple fields in my Orders? Or is there something else I'm missing?

Set the column width on your buyer/seller dropboxes to 0"1".

Change the latter number till its wide enough to show the whole thing if that's too small.

What you're doing is setting the width of each column shown, so you can't show the first column because there is 0 space to show it. This is probably what has already happened with your employee dropbox.
 
I feel really stupid. Changed the col count and the col width, and it's working flawlessly. Thank you so much.
 

Users who are viewing this thread

Back
Top Bottom