OnExit

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an OnExit event for a combo box that generates a message "You must enter a number to search on" if a user doesn't enter a number. I want the cursor to return to the combo box, so I wrote Me.cboTrack.SetFocus, but the cursor doesn't return to the combo box. Not sure why. Will appreciate any help

The combo box also has an AfterUpdate event that applies a filter to the form. That works fine.

Howar
 
The long explanation is that you cannot use the SetFocus
method while Access is in the process of changing the focus
from one control to another. Instead you have to cancel
the change of focus i.e. replace Me.cboTrack.SetFocus with
Cancel = True

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I have an OnExit event for a combo box that generates a
message "You must enter a number to search on" if a user
doesn't enter a number. I want the cursor to return to the
combo box, so I wrote Me.cboTrack.SetFocus, but the cursor
doesn't return to the combo box. Not sure why. Will
appreciate any help.
The combo box also has an AfterUpdate event that applies a
filter to the form. That works fine.
 
Back
Top