Does anyone know hoe to change the Control Source of a Form from a ComboBox within the Form itself?
For example, I have several Queries with data in. Each Query has a unique name (obviously). The selection from a ComboBox generates one of the Query names. This is confirmed to me in Design Veiw when I have a TextBox displaying the recent selection from the ComboBox.
I have tried a simple Combo_Click, and, the same code for Combo_AfterUpdate:
Private Sub Combo13_Click()
Form.RecordSource = Combo13.Value
Form.Requery
End Sub
And, I have also tried registering the value of the ComboBox as a string:
Private Sub Combo13_Click()
Dim ag_Record_Source As String
Combo13.Value = ag_Record_Source
Form.RecordSource = ag_Record_Source
Form.Requery
End Sub
For example, I have several Queries with data in. Each Query has a unique name (obviously). The selection from a ComboBox generates one of the Query names. This is confirmed to me in Design Veiw when I have a TextBox displaying the recent selection from the ComboBox.
I have tried a simple Combo_Click, and, the same code for Combo_AfterUpdate:
Private Sub Combo13_Click()
Form.RecordSource = Combo13.Value
Form.Requery
End Sub
And, I have also tried registering the value of the ComboBox as a string:
Private Sub Combo13_Click()
Dim ag_Record_Source As String
Combo13.Value = ag_Record_Source
Form.RecordSource = ag_Record_Source
Form.Requery
End Sub