OnExit

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
 
G

Gerald Stanley

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top