Quote:
Originally Posted by ADezii
Assuming your Text Box is named txtTest, placing this code in the BeforeUpdate() Event Procedure should solve your problem:
- Private Sub txtTest_BeforeUpdate(Cancel As Integer)
-
If IsNull(Me![txtTest]) Then
-
MsgBox "You must enter a value in this Field", vbExclamation, "Entry Required"
-
Cancel = True
-
End If
-
End Sub
Hi I am working on a similar thing and I found your post, that only seems to catch if you enter a space, or enter something then delete it,
Would a solution be to bind the box with a space in it as default? or is there a way of checking a null value?
like straight after btnClick()
IF me.txtInput=null Then
Msgbox "Enter a value"
Else
...
End If
That code won't work though, it doesn't seem to recognise it, I put it before my Dims and everything, right at the top of the code.
And also, it won't let a user click a cancel button for the form until they enter a value, that could be annoying. Ideally I am looking for something to catch a null value on the btnClick