Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem With Linking 2 Tables 2

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
0
0
MY
Hi all,

I am having problem with linking two tables. Here is an example:

Orders table
-------------
OrderId (autonumber)
Description
SupplierID (Number)

Supplier Table
----------------
SupplierID (autonumber)
Description

I then link both the tables together which just work fine. (one to Many as the relationship)

In Design mode in the Orders Table I then choose SupplierID field as a combo box and have the following code as the row source : SELECT DISTINCTROW supplierID, Description FROM supplier

However upon entering Data in the ORDERS table, when clicking on the supplierID fields it shows the numbers instead of the description. I have review the NorthWind example of the database and everything seems to be the same. What am I doing wrong?? ANy advice is much appreciated.

Thanks
 
Go into your table in design view and click on your SupplierID field. Down below you will see a tab that says "Lookup". In that tab you'll see a bunch of properties the important ones are:

Column Count: # of columns you want
Column Widths: Width (in inches) of each column
List Width: Width of entire list regardless of column widths

Make sure that your column count is 2, and I am assuming you don't want to see the SupplierID number and only the description so you can set the widths to '0",2"'. Then set the list width to 2" and you'll only get the Description showing two inches wide when you select that field.

HTH Joe Miller
joe.miller@flotech.net
 
I think your problem is with the combobox format. I assume you have your combo box set up to display two columns (SupplierID, Description) and it is bound to column 1. To have it still capture the value of column 1 (SupplierID)in your table but only dispay column 2 (Description) you need to make the width of column 1 0". This is done in the proprties dialog box under the format tab. In design view, select the combo box, open the properties dialog box and select teh format tab. In the Column Widths field change the width of the first column to 0" and make sure the List Width field matches the total of the Column Widths field. You should now see the descriprion in the combo box instead of the number.

Hope this helps.
 
Thank You very much. It's working Fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top