blank values

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

Guest

im trying to find a way of not letting the user move to the next form unless
a value is present in a field which has a combobox with no value on open, i
also need to know what the value of a field with nothing added to it so i can
carry out if statements to display message boxes if there is no value
present. im using access 2003, thnx in advance
kris
 
im trying to find a way of not letting the user move to the next form
unless a value is present in a field

I don't really understand the rest of this post, but the usual way to do
this is the use the BeforeUpdate event and set the Cancel argument to True
if the validation fails.

HTH


Tim F
 
I don't really understand the rest of this post, but the usual way to do
this is the use the BeforeUpdate event and set the Cancel argument to True
if the validation fails.

HTH


Tim F

I think maybe this part "i also need to know what the value of a field
with nothing added to it " is referring to a blank field? Wouldn't
that be Null?

RD
 
I think maybe this part "i also need to know what the value of a field
with nothing added to it " is referring to a blank field? Wouldn't
that be Null?

Or just set the control's Required property to True.

Or using the event

private sub txtMyControl_BeforeUpdate(Cancel as integer)

If isNull(txtMyControl.Value) Then
' warn the user
Msgbox "You have to enter a value for MyControl"
' and prevent moving off
Cancel = True

End If
End Sub


but the other thing to note is that this will screw up the user if he or
she wants to quit the form without entering anything. Most of the time,
if you have a Required field or a Required control, it's best to provide
a Default Value so that doing nothing is still okay.

All the best



Tim F
 
Back
Top