M
Mark A. Sam
Hello,
I have a procedure to set the RecordSource of a form in the AfterUpdate
event of a ComboBox. Using the Change event of the came Combobox I want the
AfterUpdate event to run when the user hits the delete key to clear the
ComboBox value. Here is the method. I moved the code to a button hoping I
could resolve this.
Private Sub TruckFilter_Change()
If TempVars("aUpdate") = False And [TruckFilter].Text = "" Then
[TruckFilter] = Null
Call RunFilterCode_Click
End If
TempVars("aUpdate") = False 'This variable is set to true in the AfterUpdate
event to indicated to the ChangeEvent that AfterUpdate event fired first.
'This happens when selection is made from ComboBox rather then typing in
text.
End Sub
When I reference the .text property of the combo I get this message when
selecting from the Combo list.
Error 2185
You can't reference the a propety or method for a control unless the control
has the focus.
I'm puzzled as to why the control doesn't have the focus.
Thanks for any help and God Bless,
Mark A. Sam
I have a procedure to set the RecordSource of a form in the AfterUpdate
event of a ComboBox. Using the Change event of the came Combobox I want the
AfterUpdate event to run when the user hits the delete key to clear the
ComboBox value. Here is the method. I moved the code to a button hoping I
could resolve this.
Private Sub TruckFilter_Change()
If TempVars("aUpdate") = False And [TruckFilter].Text = "" Then
[TruckFilter] = Null
Call RunFilterCode_Click
End If
TempVars("aUpdate") = False 'This variable is set to true in the AfterUpdate
event to indicated to the ChangeEvent that AfterUpdate event fired first.
'This happens when selection is made from ComboBox rather then typing in
text.
End Sub
When I reference the .text property of the combo I get this message when
selecting from the Combo list.
Error 2185
You can't reference the a propety or method for a control unless the control
has the focus.
I'm puzzled as to why the control doesn't have the focus.
Thanks for any help and God Bless,
Mark A. Sam