By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Data does not update to table

P: 10
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.
Apr 8 '10 #1

✓ answered by missinglinq

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)>

Share this Question
Share on Google+
5 Replies


missinglinq
Expert 2.5K+
P: 3,532
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)>
Apr 8 '10 #2

P: 10
Thank this did work, but how would this work with multiple fields to auto populate the table? I entered
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo26_AfterUpdate()
  2.   Me.UPC_Code = Me.Combo26.Column(2)
  3. End Sub
Would I enter another Me statement to this code, like Me.txtboxname=Me.comboboxname.column(x)
Apr 8 '10 #3

missinglinq
Expert 2.5K+
P: 3,532
Exactly!

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo26_AfterUpdate()
  2.    Me.UPC_Code = Me.Combo26.Column(2)
  3.    Me.AnotherField = Me.Combo26.Column(3)
  4.    Me.YetAnotherField = Me.Combo26.Column(4)
  5. End Sub
Apr 8 '10 #4

P: 10
Thank you very much. I did try this method and it works great.
Apr 8 '10 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Apr 9 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.