View Full Version : Bypassing Validation rule on form ??


Franky G
02-07-2001, 03:22 AM
Hi all,

I have a button which I use to clear various fields, as below.

Private Sub Clear_Form_Command_Button_Click()
Me.From_Date = Null
Me.Until_Date = Null
Me.Description_Text = Null
Me.Area_Team = Null
Me.Requery
End Sub

trouble is, when either of the date fields fails to meet the Validation rule (>=#01/01/1998# And <=Date()) or the input mask (99/99/0000;0;_), Access insists that I correct the date before do anything else, including using my 'Clear Form' button!

Is there any way that the validation rule and the input mask can be bypassed when I press the Clear form button?

Thanks

Frank G

norm
02-08-2001, 10:59 AM
Try adding something like the following:

'Or Is Null' or
'Or IsNull' or
(<your expression> Or Is Null)

to the expression.

Hope it helps,
norm