Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kishan - 23 Apr 2005 13:59 GMT
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  
Ken Snell [MVP] - 23 Apr 2005 17:21 GMT
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]*"

Signature

       Ken Snell
<MS ACCESS MVP>

> Hi, i have a table where passwords are kept and i need a vaidation rule
> that
[quoted text clipped - 6 lines]
> thanks
> kishan
david epsom dot com dot au - 25 Apr 2005 04:08 GMT
> 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)

> One should not enter data directly into the table. Use a form for that
> purpose!
[quoted text clipped - 24 lines]
>> thanks
>> kishan
Ken Snell [MVP] - 25 Apr 2005 14:18 GMT
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.

Signature

       Ken Snell
<MS ACCESS MVP>

>> write/test/handle the validation. If you put the Validation Rule table,
>> ACCESS will generate an error message that may or may not
[quoted text clipped - 36 lines]
>>> thanks
>>> kishan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.