Text Box

rhernand

Registered User.
Local time
Today, 03:21
Joined
Mar 28, 2003
Messages
96
I have a Combo Box driven by a query which has hidden columns in the combo. I have created text boxes that I want to populate with these hidden columns. In the AfterUpdate of the Combo, I have Me.TxtEmpNum=Me.cboEmployee.Column(3), but I get compile error: 'Method or member data not found'. Is this not correct? I will use the text box value to insert a record to a table with an AddNew by using
.Fields("EmployeeNumber") = TxtEmpNum. :confused:
 
That looks fine, assuming the names are correct. You're aware that the column property is zero based, so 3 represents the 4th column?
 
I had forgotten that, it was Column(2) that I wanted. However, I still get the compile error. Is the Text Box bound?
 
Is the Text Box bound?
No clue; I'm supposed to ask you that kind of question (but it doesn't matter in this case). The debugger brings you to that line? The error implies one of the control names is wrong. Have you double checked them?
 
Nevermind, I missplelled Me.TxtEmpNum=Me.cboEmployee.Column(3), should have been Me.cboxEmployee. Thanks it works fine
 
Glad you sorted it out. For the future, an advantage of using "Me." is you'll get a list of most of the valid selections, so simply selecting from that list ensures you won't misspell a name.
 

Users who are viewing this thread

Back
Top Bottom