Combo box populate table fields

dhoward81

New member
Local time
Today, 07:38
Joined
May 26, 2013
Messages
4
I'm trying to create a form using a combo box to populate multiple fields and tables.
I've created a text field to display the added information using this format:
=Comboboxname.Column(x)
in the text box control source field, and this works for display purposes.
However, I need it to populate this data into a field on a table.

For example:
My combo box looks up data that has 2 columns, Part Number and Description.
The control source for the combo box is "Part Number". And that populates the part number in the "Main" table no problem.

The text box I created using the above format in the control source populates the field in the form, but not the "Main" table.

Is there a way for the other (description) field to also populate the "Main" table as well?

Thanks,
David
 
You could use a DLOOKUP
http://599cd.com/tips/access/dlookup-function/?key=AlexForumAF

Code:
=DLOOKUP (Field, Domain, Criteria)
e.g.
Code:
=DLOOKUP ("LastName", "CustomerT", "CustomerID=5")
Or
Code:
=DLOOKUP ("Address", "CustomerT", "CustomerID=" & CustomerCombo)

Just set the source/default value of your textbox to that or set it in the after update event of the combobox.

--
You can also use a Combo box to search for current records
http://599cd.com/tips/access/121114-combo-box-search/?key=AlexForumAF
 
Given that your Combo is able to populate an unbound text box using;
Code:
=Comboboxname.Column(x)

Why do you then need to store that value elsewhere :confused:
 
I'm trying the DLookup but not having any success. I just get an error when I enter it in the Control Source field of the Text box. I'll keep trying though.
 
A light finally came on.
using the =Comboboxname.Column(x)
format in the text box, then created a relationship between the part number table and Main table, then ctreated a new query showing the data I needed.

I'll need to take some lessons in VBA.
Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom