Connecting Tech Pros Worldwide Forums | Help | Site Map

combo box with two tables?

Newbie
 
Join Date: Sep 2009
Posts: 5
#1: Oct 21 '09
Ok, I have table A with email address and primary key autonumber. the email addresses are stored here.
next i have table B with other information that i want stored and a form for it.
there is one combo box on the form and i can see the email addresses from tableA, but when it stores them in tableB, the field has the autonumber value not the actual email address which i want pulled from tableA for that specific record.

whats the correct way to get the address filed to store instead of the autonumber?

thanks
best answer - posted by NeoPa
Look at the properties of the ComboBox.

Your .ControlSource property is fine, but you need to ensure that the .RowSource and the .BoundColumn properties are set up to match and to return the text value rather than the AutoNumber field.

You should be careful also to ensure .ColumnWidths is set correctly too.

NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,722
#2: Oct 22 '09

re: combo box with two tables?


Look at the properties of the ComboBox.

Your .ControlSource property is fine, but you need to ensure that the .RowSource and the .BoundColumn properties are set up to match and to return the text value rather than the AutoNumber field.

You should be careful also to ensure .ColumnWidths is set correctly too.
Newbie
 
Join Date: Sep 2009
Posts: 5
#3: 4 Weeks Ago

re: combo box with two tables?


you sir are a genius.
it was the .boundcolumn that was giving me the trouble. I was unaware that the bound column is refering to the query built on the combobox, I thought it was looking at the table!
just solved 2 days of frustration.
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,722
#4: 4 Weeks Ago

re: combo box with two tables?


Very pleased it was that straightforward razoRjaw :)

Have fun with your project.
Reply