I thought I had a simple task until I tried it :-)
I have a form with multiple controls bound to fields on an underlying table. In one case I have a combo box whose values come from a query that has a few columns of data. The first column of those values is bound to a numeric data field of the table. A second control on this form is a text box that is bound to another field in the underlying table that happens to be a short text field.
What I want to do is this: When you select a value from the combo box, I want to set the value of the text box automatically. So I put some simple code in the After Update event of ComboBox2 that looks like this:
Me.txtBox1.Value = Me.ComboBox2.Column(2)
That doesn't seem to work. I put a Msgbox statement in there to confirm that I'm capturing the right event and the correct column of the combo box to get the value I want. But the txtBox1 value doesn't change. I tried adding this after my attempt to change txtBox1 to force the issue. No luck
Me.txtBox1.Requery
I also tried to reference the text box without the "Value" property, like this...
Me.txtBox1 = Me.ComboBox2.Column(2)
The general goal is allow the user to make a selection from the combo box, but have it update two different fields in the underlying table. The combo box is bound to a numeric field and the text box is bound to a short text field.
Any help is appreciated.