Hello,
I'm trying to add some data validation to the BeforeUpdate event of a
form. I want the user to select a number between 1 and 3 for the
[Choice] field. Can I use something like IsNot? Sorry, a little
rusty here!
Thanks
=============== ======
Private Sub Form_BeforeUpda te(Cancel As Integer)
'Data validation to ensure a choice number between 1 and 3 is
selected.
If IsNot (Me.Choice (>=1 And <=3) Then
MsgBox "Please select a choice number between 1 and 3.."
DoCmd.CancelEve nt
Me.Choice.SetFo cus
End If
I'm trying to add some data validation to the BeforeUpdate event of a
form. I want the user to select a number between 1 and 3 for the
[Choice] field. Can I use something like IsNot? Sorry, a little
rusty here!
Thanks
=============== ======
Private Sub Form_BeforeUpda te(Cancel As Integer)
'Data validation to ensure a choice number between 1 and 3 is
selected.
If IsNot (Me.Choice (>=1 And <=3) Then
MsgBox "Please select a choice number between 1 and 3.."
DoCmd.CancelEve nt
Me.Choice.SetFo cus
End If
Comment