sorry!
well the tab order(first)is set to this combo box. the box is blank
until
you click on drop down and pick. if you do not click on drop down and
leave
it blank - you can tab (off focus) without getting a "NEED DATA ENTRY"
message.
i need taht combo box to be populated every time a person creates a
record.
which event do i use? what code?
thanks guys!
:
You lost me with the focus piece?
thanks susan - i will try but i dunno if this will work - where do i
put
this code? which event?
basically i want the focus to be on it (tab) and then focus to be off
(tab)
and if blank happen there.
:
Yes I understand what you're saying. You see, once you select an
item,
then
delete it, the filed is no longer null - now it's BLANK. Which is why
you
need the OR in the if statement:
If IsNull(Me.RequiredField) OR Me.RequiredField = "" Then
Or, if you want to go the other way and test for NOT null or blank:
If NOT IsNull(Me.RequiredField) OR Me.RequiredField <> "" Then
Hope that's a bit clearer...
SusanV
hey susan - it is an input for with combo and text boxes. it has
an
"add
record" button and "refresh" button and "close form" button.
there are about 8 combo boxes that NEED to be populated.
in the validation part of the combo boxes i put
Is Not Null
-
the result is - when i open the form and the click on combo box
(nothing
shows) and then click off - it doesnt prompt me to input something.
BUT when i click on combo boc and then pick something from list and
THEN
delete that something (now blank again) - i try to click off box
and
validation text comes up saying to populate.
does this help? i am sure it is easy but having hard time
conceptualizing
it/ thank sugys.
:
sbs,
It's hard to say without knowing what other controls are on the
form.
Do
you
have a "save" button? Navigation buttons? Moving to a new record
or
closing
the form is going to save the record automatically, so if you
don't
want
the
user to be able to create/save a record without this control being
populated
you would need to pretty much cover all of those bases, so to
speak.
I have a form with a similar requirement. I removed the Close
control
from
the form and the navigation bar - forcing the user to use the
buttons
I
created to do these operations. On each button, I have code
similar to
the
following:
Sub btn_Click
If IsNull(Me.RequiredField) OR Me.RequiredField = "" Then
MsgBox "You must choose an option in RequiredField!"
Exit Sub
Else
'Do whatever the button is meant to do - save, next, etc
End If
End Sub
Keep in mind, however, that if they close Access itself with the
form
open,
they will bypass all these controls, so it's still possible that
you
might
have a record with RequiredField not populated...
--
hth,
SusanV
schas - i am not sure what you mean and where to put it.
is null in the validation section of box works ONLY when you
pick a
value
and then erase and then trry to get to antoher box.
:
If not isnull([comboBox]) then
..........
:
hey guys - i have a combo box - i NEED the user to enter a
choice
from
that
combo list. how do i validate that something is input?
thanks!