Required Field - space bar

Jake94

Registered User.
Local time
Today, 10:57
Joined
Dec 28, 2006
Messages
15
How can I adjust my required field so that you cannot simply enter a space bar character to circumvent the requirement?

Here is part of the code:

If IsNull([txtRequiredReason]) Then
MsgBox "The Reason field is required"
DoCmd.GoToControl "txtRequiredReason"

Else


Thanks,

Jake
 
Try this:

Code:
Dim strTest As String
 
strTest = Replace([txtRequiredReason], " ", "")
 
If Nz(strTest, "") = "" Then
    MsgBox "The Reason field is required"
    DoCmd.GoToControl "txtRequiredReason"
Else
 

Users who are viewing this thread

Back
Top Bottom