combobox value inserted as ID#!!

laythss

Registered User.
Local time
Yesterday, 17:38
Joined
Aug 23, 2005
Messages
15
I am just starting with access and I have a VERY stupid question. I made a combobox (it gets its values from a table with 2 colums the first the ID and the second is the products) when a user selects one of the products in the combobox the combobox is supposed to update another table with that value (and I mean the product name) yet what it updates is the ID # of the product that was selected!! How do i go around this.
I am new to access so i am not sure how things are done yet in access, i am pretty good in VBA in excel, but this is a new front for me that I am trying to learn. I did the above combobox using the wizard.

Layth
 
Hey laythss,

You have 2 columns in your cboBox. The first column is bound, which is your ID# so if you don't tell Access the specific column you want the value from then it assigns the first column, so it sounds like you need to tell Access you want the second columns value. Also, one other thing to know is Access starts counting at 0, so your second column is actually 1 and not 2. An example of assigned the second columns value say to a text box would be:

Me.TextBox = Me.cboBox.Column(1)

HTH,
Shane
 
It sounds like your ComboBox was doing just as it should which is putting a ForeignKey value in the other table. The "ProductName" should only exist in one table in your database and the other tables can always get the "Name" from there. You can always display the ProductName with queries that join that table to whatever else you are working with.
 

Users who are viewing this thread

Back
Top Bottom