Using MS Access/Validation rule

Advertisement


Question
Hello Scott
I am trying to put a validation rule against a text box to limit the value to the following:
Kingsley-Jones
No Spaces, No Numbers and No other characters except the hyphen and the letters a-z.
I have been playing around with Is Null OR Not Like "*[!((a-z) or (-))]*" but it always allows spaces and gives me the validation rule message.
Can you head me in the right direction please.
Thanks a heap
Dave

Answer
Sorry not to answer sooner.

You want to limit the entry to just that exact string? Why not just make that the default value and lock the control?

If you just don't want spaces, why not try an input mask instead?

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.