Update Value in Combo Box

j2curtis64

New member
Local time
Today, 06:09
Joined
May 10, 2011
Messages
8
Hello,

I want to be able to update value in text box based on the value in a combo box. This would be in a Access form.

For example, I have the following values in a table.

Name Number
Johnson 1234
Curtis 5678
Jones 2468

In my form, one of my fields i display Johnson (name field) by using a Combo Box. Then I have text box that i want to update the value automatically based on the value in the "name" field. So for this example i would want the value to be 1234. How would i do this?
 
The Row Source of the combo box needs to include both columns (fields). You can set the width of the Number column to 0 if you don't want it to be shown when the combo box is expanded. Then, in the Control Source of the text box put;

=[YourComboBox].Column(1)

It is a zero based index, so the first column (in this case the Name field) is Column(0), the second column (in this case the Number field) is Column(1), etc.
 
Thank you very much!

Mark
 
Now I am noticing when i input data in my form the primary key field in my underlying table is not populating. Any one know why? The other fields are updating.
 

Users who are viewing this thread

Back
Top Bottom