I have a form with a combo box. I also have a expression in a text field to paste the data from the combo box into the specific field. This works, but the data does not update/refresh to the table. How to fix this issue.
Data does not update to table
Collapse
X
-
My guess would be that you have this expression in the Control Source for the textbox. You need to move the code from there, make the Control Source the field in the underlying table where you want to store this data, then place your expression in the Combobox AfterUpdate event. Something like
Me.TextBoxName = Me.ComboboxName .Column(x)
where X is the number for the appropriate field in the Combobox. Remember that the fields, running left-to-right in the dropdown, start at zero.
Welcome to Bytes!
Linq ;0)> -
Thank this did work, but how would this work with multiple fields to auto populate the table? I entered
Would I enter another Me statement to this code, like Me.txtboxname=M e.comboboxname. column(x)Code:Private Sub Combo26_AfterUpdate() Me.UPC_Code = Me.Combo26.Column(2) End Sub
Comment
-
Exactly!
Code:Private Sub Combo26_AfterUpdate() Me.UPC_Code = Me.Combo26.Column(2) Me.AnotherField = Me.Combo26.Column(3) Me.YetAnotherField = Me.Combo26.Column(4) End Sub
Comment
-
Comment