S
SimonG via AccessMonster.com
Hi,
I have an unbound control on a form. The control is used as a 'quick find',
where as the user types in the box the record moves accordingly*. This works
correctly, however when the user moves away from the control I would like the
contents of this unbound control to be removed.
* Note as the record changes the unbound control is not cleared (this is
correct for this control).
I have tried using events “On Lost Focus†and “On Exitâ€. Both of these
appear to be “all or nothingâ€, with initially, the unbound control being
cleared as soon as the record changes (not wanted). Then modifying my code
(see below), the unbound control now never clears.
'Code as applied to “On Exit†event:
Private Sub txtQuickFind_Exit(Cancel As Integer) 'unbound control is
“txtQuickFindâ€
If Me.ActiveControl.Name <> "txtQuickFind" Then
Me![txtQuickFind] = ""
End If
End Sub
Can someone suggest how I can test for and clear the unbound control only
when the user moves to another control?
Many thanks,
Simon
I have an unbound control on a form. The control is used as a 'quick find',
where as the user types in the box the record moves accordingly*. This works
correctly, however when the user moves away from the control I would like the
contents of this unbound control to be removed.
* Note as the record changes the unbound control is not cleared (this is
correct for this control).
I have tried using events “On Lost Focus†and “On Exitâ€. Both of these
appear to be “all or nothingâ€, with initially, the unbound control being
cleared as soon as the record changes (not wanted). Then modifying my code
(see below), the unbound control now never clears.
'Code as applied to “On Exit†event:
Private Sub txtQuickFind_Exit(Cancel As Integer) 'unbound control is
“txtQuickFindâ€
If Me.ActiveControl.Name <> "txtQuickFind" Then
Me![txtQuickFind] = ""
End If
End Sub
Can someone suggest how I can test for and clear the unbound control only
when the user moves to another control?
Many thanks,
Simon