Validation Rule

E

Eric

I put the following validation rule on a field:
Is Null OR Not Like "*[!((a-z) or (0-9))*"
The rule is suppose to only allow letters and numbers, however it will not
allow anything! Any suggestions on what I am doing wrong. (I have access
2000 not sure if this matters.
Thanks,
Eric
 
K

Ken Sheridan

Eric:

Try:

Is Null Or [FieldNameGoesHere] Not Like "*[!a-z,!0-9]*"

In a form you could use the control's KeyPress event procedure. This has
the advantage of allowing or reject each character individually, e.g.

Select Case KeyAscii
Case 97 To 122 ' a-z
' accept
Case 65 To 90 'A-Z
' accept
Case 49 To 57 ' 0-9
' accept
Case 8 ' backspace
' accept
Case Else
' reject
KeyAscii = 0
End Select

Ken Sheridan
Stafford, England
 
J

John Spencer

Try

NOT LIKE "*[!0-9A-z]*"

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top