Re: Validation Rule - must have at least 1 number and 1 letter

0 views
Skip to first unread message

Ken Snell [MVP]

unread,
Apr 23, 2005, 12:21:44 PM4/23/05
to
One should not enter data directly into the table. Use a form for that
purpose!

That noted, where you use the Validation Rule sometimes is a matter of
preference; other times, it's a matter of where it's easier to
write/test/handle the validation. If you put the Validation Rule in the
table, ACCESS will generate an error message that may or may not be
meaningful to your user; a similar situation occurs if you use the
Validation Rule for a control on a form. If you want to control the message
that is displayed, you need to use the Form's Error event to trap the
specific error for the specific control and substitute your own message. Or
use the control's AfterUpdate or BeforeUpdate event (or the form's
BeforeUpdate event) to capture the error.

A validation rule that says you must have a letter and number (assuming
either can be "first" in the string's contents):
Like "*[0-9]*[a-z]" Or Like "*[a-z]*[0-9]*"

--

Ken Snell
<MS ACCESS MVP>


"kishan" <kis...@discussions.microsoft.com> wrote in message
news:41ADA695-29F1-409E...@microsoft.com...
> Hi, i have a table where passwords are kept and i need a vaidation rule
> that
> means the password must have at least one letter and one number. Also woud
> it
> be easier to have the coding on a form or in the validation option in the
> table design (i would prefer not to have a form for this table so can the
> coding go in the validation rule box in the table design).
>
> thanks
> kishan


david epsom dot com dot au

unread,
Apr 24, 2005, 11:08:53 PM4/24/05
to
> write/test/handle the validation. If you put the Validation Rule table,
> ACCESS will generate an error message that may or may not
> meaningful to your user; a similar situation occurs if you use

There is a matching 'Validation Text' property.
('The error message that appears when you enter a value prohibited by the
validation rule')

(david)


"Ken Snell [MVP]" <kthsne...@ncoomcastt.renaetl> wrote in message
news:uSKfCCCS...@TK2MSFTNGP14.phx.gbl...

Ken Snell [MVP]

unread,
Apr 25, 2005, 9:18:11 AM4/25/05
to
This is true... I so rarely use the table's validation rule that I
overlooked it in my "memory search". I was thinking of the standard error
message generated in the form's error event.

Thanks, david.

--

Ken Snell
<MS ACCESS MVP>

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:OkVYeQUS...@TK2MSFTNGP14.phx.gbl...

Reply all
Reply to author
Forward
0 new messages