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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box and Text Box

Status
Not open for further replies.

yakdogs

Programmer
Aug 13, 2002
40
US
I have a combo box that has two columns, when the user picks from the combo box I would like the second column to fill into another text box.

Meaning combo box:
Employer Name (Column 1) Employer No (Column 2)

Text box = Employer No

Is this possible? If so please your help would be appreciated.
 
Indexes are zero based in Access unless set otherwise. So, the columns are index positions 0 and 1.

textfield = Me.comboboxName.Column(1) 'is column 2

Put the code in the click event of the combo box.
 
TextBox = ComboBox.column(2) Remember amateurs built the ark - professionals built the Titanic

[flush]
 
opps thats right columns start at 0 (-: Remember amateurs built the ark - professionals built the Titanic

[flush]
 
try the AfterUpdate event of the combo Remember amateurs built the ark - professionals built the Titanic

[flush]
 
I just wanted to say Thanks, this really helped, and have made my life a little easier.

 
I have tried it but I am now getting an error as such:
Run-time error; There is a problem accessing a property or method or the OLE object.
 
post your code Remember amateurs built the ark - professionals built the Titanic

[flush]
 
Private Sub Employer_AfterUpdate()
ER_Number = Me.Employer.Column(1)
End Sub

This is what I have.
 
I'm only guessing but try changing the name of your text box to something like txtER_Number. Maybe access thinks your trying to reference a property of the Errors Object.

hth Remember amateurs built the ark - professionals built the Titanic

[flush]
 
Sorry for being late in answering MAXWORX, it tried it and it works. Thanks for your help.
 
np (-: Remember amateurs built the ark - professionals built the Titanic

[flush]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top