Hi mbair!
If you want to force the user to enter a value in the textbox (if it is bound) set its required property to Yes in the table design and the user will not be allowed to leave the form without completing it.
Also, use code like this in the [!]BeforeUpdate[/!] event of the control to disallow the null and force data entry:
Code:
[COLOR=blue]Private Sub[/color] myTextbox_BeforeUpdate()
[COLOR=blue]If[/color] IsNull(Me.myTextbox.Value) = [COLOR=blue]True Then[/color]
Cancel = [COLOR=blue]True
End If
End Sub[/color]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.