G
Guest
I have a combo box that has three values in it
SELECT
AP
CS
I'm trying to write code to require something be selected besides
'SELECT' which is the default.
If the user skips the box
I don't want to use the form's after update event to catch this error later,
I want it to immediately bounce back to the control if they skip it.
I've tried the lostfocus event like this:
if me.cboDptSelect = "SELECT" then
msgbox "Please select your department"
me.cboDptSelect.setfocus
end if
it's weird, it only works sometimes.
If I use my mouse to select another field, I get the message, but
It doesn't set focus back to the box
I don't want to write code in every other GotFocus box of my form to check
this.
Somehow, I always manage to get this to work serendipitously with various
methods, but there must be a standard way to provide "suction" to a required
control that is skipped.
SELECT
AP
CS
I'm trying to write code to require something be selected besides
'SELECT' which is the default.
If the user skips the box
I don't want to use the form's after update event to catch this error later,
I want it to immediately bounce back to the control if they skip it.
I've tried the lostfocus event like this:
if me.cboDptSelect = "SELECT" then
msgbox "Please select your department"
me.cboDptSelect.setfocus
end if
it's weird, it only works sometimes.
If I use my mouse to select another field, I get the message, but
It doesn't set focus back to the box
I don't want to write code in every other GotFocus box of my form to check
this.
Somehow, I always manage to get this to work serendipitously with various
methods, but there must be a standard way to provide "suction" to a required
control that is skipped.