There is a text box
CCS1
which allows the user to enter a 4 digit number to runt the report. However, I was thinking that if they were to delete the value and not replace it the report would go off.
Instead of running incorrectly it simply says invalid use of null.
Therefore I was thinking of a way to make a msgbox appear if they try to run the report with nothing in the text box.
I have tried...
Private Sub CCS1_AfterUpdate()
If Me.CCS1 < 1000 Or Me.CCS1 Is Null Then
MsgBox "No Summary Cost Center Selected"
Me.CCS1 = 0
End If
End Sub
but it says Object required. I have tested taking the "is null" part off and it work so my guess it is my wording.
Ideally I would like to put something on the report button instead basically reading... if the value in CCS1 is null or <1000 msgbox "need...." otherwise run the report
Any suggestions?
CCS1
which allows the user to enter a 4 digit number to runt the report. However, I was thinking that if they were to delete the value and not replace it the report would go off.
Instead of running incorrectly it simply says invalid use of null.
Therefore I was thinking of a way to make a msgbox appear if they try to run the report with nothing in the text box.
I have tried...
Private Sub CCS1_AfterUpdate()
If Me.CCS1 < 1000 Or Me.CCS1 Is Null Then
MsgBox "No Summary Cost Center Selected"
Me.CCS1 = 0
End If
End Sub
but it says Object required. I have tested taking the "is null" part off and it work so my guess it is my wording.
Ideally I would like to put something on the report button instead basically reading... if the value in CCS1 is null or <1000 msgbox "need...." otherwise run the report
Any suggestions?