Data entry must include at least one alpha character

J

John134

Is it possible to provide an input mask or a validation rule so that the
entry must have at least one alpha character? Any number of characters is
acceptable.

And, would it also be possible that it start with a digit?

John134
 
J

John134

Thanks for the reply, Allen. The Like expression worked but the IsNull
didn't. I tried Not Is Null and that didn't prevent the field from being
skipped over either. The same with putting the rule on the control property.

I tried putting Not IsNull(fieldname) in the table properties and had no
luck there either.

Any suggestions appreciated.

John134
Allen Browne said:
Try a validation rule of:
Is Null OR Like "#*[a-z]*"

More info and examples of validation rules:
http://allenbrowne.com/ValidationRule.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

John134 said:
Is it possible to provide an input mask or a validation rule so that the
entry must have at least one alpha character? Any number of characters is
acceptable.

And, would it also be possible that it start with a digit?

John134
 
A

Allen Browne

If you want to *block* null, just set the field's Required property to Yes,
and use a validation rule of:
Like "#*[a-z]*"

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

John134 said:
Thanks for the reply, Allen. The Like expression worked but the IsNull
didn't. I tried Not Is Null and that didn't prevent the field from being
skipped over either. The same with putting the rule on the control
property.

I tried putting Not IsNull(fieldname) in the table properties and had no
luck there either.

Any suggestions appreciated.

John134
Allen Browne said:
Try a validation rule of:
Is Null OR Like "#*[a-z]*"

More info and examples of validation rules:
http://allenbrowne.com/ValidationRule.html

John134 said:
Is it possible to provide an input mask or a validation rule so that
the
entry must have at least one alpha character? Any number of characters
is
acceptable.

And, would it also be possible that it start with a digit?
 
J

John Spencer

The test only works if something causes the control to detect a change.
Simply entering the control and leaving it will not cause the control to
detect a change in its text value.

If you enter one character into the control and then delete the character the
control will detect the change and will check the validation rule.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Thanks for the reply, Allen. The Like expression worked but the IsNull
didn't. I tried Not Is Null and that didn't prevent the field from being
skipped over either. The same with putting the rule on the control property.

I tried putting Not IsNull(fieldname) in the table properties and had no
luck there either.

Any suggestions appreciated.

John134
Allen Browne said:
Try a validation rule of:
Is Null OR Like "#*[a-z]*"

More info and examples of validation rules:
http://allenbrowne.com/ValidationRule.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

John134 said:
Is it possible to provide an input mask or a validation rule so that the
entry must have at least one alpha character? Any number of characters is
acceptable.

And, would it also be possible that it start with a digit?

John134
 

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

Top