Trouble with auto-fill update field.

NLR

Registered User.
Local time
Today, 02:42
Joined
Aug 29, 2012
Messages
71
Hi,
I need some help trying to update a field in a form using the after update event of a combo:
Me.TextboxName = Me.ComboName.Column(4)
I'm using the field name of the textbox in my form as the control source for the field.
The Combo is a qry to use in multiple fields as an autofill display; but one field I want to save the info into the table's field.
I don't get any error messages, but I don't see the info in my table either.
Event Procedure on After Update:

Private Sub CompID_AfterUpdate()
Me.CompID = Me.Combo1.Column(4)
End Sub

Don't know what's wrong?
Thanks for any help!
 
A combo box numbering starts with 0, not 1
The column you are wanting may be 3.

Dale
 
For reference, you may want to review the code and tips at the link below. Chip Pearson has categorized and made sample to show various debugging techniques for vba- that can become extremely useful.
http://www.cpearson.com/excel/DebuggingVBA.aspx
 
I believe my combo box is fine with 4, since my combo qry has 5 fields and I want the value that is in the 5th field.
:confused:
 
Your code needs to be in the AfterUpdate event of the Combo1 Combobox, not in the AfterUpdate event of CompID!

Code:
Private Sub Combo1_AfterUpdate()
 Me.CompID = Me.Combo1.Column(4)
End Sub
Linq ;0)>
 
Thank you! That did the trick!!
 

Users who are viewing this thread

Back
Top Bottom