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!

data pass thru

Status
Not open for further replies.

gdzilla

Technical User
Jul 22, 2002
18
0
0
US
In a Form.....

How can I do it so that when someone chooses an option from a "combo box", a value associated with it automatically comes up in the next field.

For example:

Field1(Combo Box,2 columns) Field2
option1-data1
option2-data2
option3-data3

so let's say someone chooses "option1", now "data1" should pop up in Field2. Get it?

Thanks in advance!
 
Put this code behind the afterupdate event on field1

field2= field1.Column(1)

Phil
 

Stickarm... Do I first need to create a macro for this?

I'm getting this error "Microsoft Access can't find the macro 'WorkerID=WorkerName.'

This is what I entered in the AfterUpdate event:
WorkerID= WorkerName.Column(1)
 
IS your combo box named WorkerName and is your text box named WorkerID? If so, when you click on afterupdate event select the (...) at the end of the line, then select "code builder", then under "Private Sub WorkerName_AfterUpdate()" input the text:

WorkerID= WorkerName.Column(1)

Let me know if this explains it better.
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top