Building Expression

satoshi79

New member
Local time
Today, 23:55
Joined
May 25, 2003
Messages
5
Hello there,

How do you build an expression for a text field in the table where it cannot be left blank and the length of the text entered cannot be greater than 10?

Is Not Null, is this a valid statement? If so, how do I conbine it with a check for the length of text entered.

Thanks
 
IsNul() is a function that checks for nulls and Len() is the function that detects length.

If IsNull(YourField) or Len(YourField) > 10 Then
msgbox "error"
Else
msgbox "good"
End If
 
How do you do that in Table properties under Validation Rules property?

How can you combine two rules into 1 statement?

Thanks.

Your Help is Appreciated.
 
You don't. You specify that the field is required which takes care of the null problem and you specify that the length is 10 which takes care of the length problem.

If you want to supply your own error messages, you'll still need to trap the errors in the form's BeforeUpdate event.
 
i believe the validation rule in the table would be
9?????????

?=wildcard for any character and can be left blank

9 is a required character, i think or is it 0 well its one of them look it up of just wait for someone smarter then I to correct my self.
 

Users who are viewing this thread

Back
Top Bottom