Jenkins
asked on
Set the value of a textbox equal to a combobox value
I have a combobox on a main form. The main form does not have a record source. The record source of the combobox is a table.
I have a subform on the main form. The subform's record source is a table (different from the one tied to the combobox). I have a textbox in the header area of the subform. I want to set its value to whatever the combobox's value is. If the combobox value changes, I want the textbox value on the subform to change.
I have a subform on the main form. The subform's record source is a table (different from the one tied to the combobox). I have a textbox in the header area of the subform. I want to set its value to whatever the combobox's value is. If the combobox value changes, I want the textbox value on the subform to change.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:0
ASKER
This is what I already had under the After Update event of the combobox:
Private Sub MyComboBox_AfterUpdate()
With DoCmd
.SetWarnings False
.Hourglass True
.OpenQuery "DeleteTemporaryTable"
.OpenQuery "PopulateTemporaryTable"
.SetWarnings True
.Hourglass False
End With
Me!MySubform.Form.Requery
Adding this code to the event is causing a 440 run-time error:
Me.MySubform.Form.MyTextbo x = Me.MyComboBox
Private Sub MyComboBox_AfterUpdate()
With DoCmd
.SetWarnings False
.Hourglass True
.OpenQuery "DeleteTemporaryTable"
.OpenQuery "PopulateTemporaryTable"
.SetWarnings True
.Hourglass False
End With
Me!MySubform.Form.Requery
Adding this code to the event is causing a 440 run-time error:
Me.MySubform.Form.MyTextbo
Private Sub Combo1_AfterUpdate()
Me.YourSubformControlName.
End Sub
mx