PDA

View Full Version : Solved: Encountering Run-time Error 424 when running this code.



Blitskrieg
04-06-2011, 05:48 AM
I have a simple code that i'm trying to use to determine if a textbox is null and if it is to add the date that is 3 weeks from now.

The below code is sitting on a button on a simple form. The code is triggered by an "OnClick" event.


Private Sub NextBtn_Click()
If [Follow Up Date] Is Null Then
[Follow Up Date] = Date + 21
End If
End Sub



Any ideas?

hansup
04-06-2011, 07:45 AM
Something Is Null works in a query.

For your VBA code, use the IsNull() function.

If IsNull([Follow Up Date]) Then

Blitskrieg
04-06-2011, 08:01 AM
That was the problem, many thanks!