Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the minimum amount of characters in a text box

Status
Not open for further replies.

ChrisHaynes

Technical User
Mar 9, 2006
80
GB

Hi, How can I check that a field in my form contains a minimum of say, 5 characters when I click a command button?

I am going to use it with an if statement for example:


Code:
if Me!Password (is less than 5 characters long) then
msbox "Password needs to contain a minimum of 5 characters"

Thanks,
Chris
 
Thanks Spenney. I have it sorted now

Code:
 If Len(Me!Username) < 7 Then
       MsgBox "Username needs to contain a minimum of 7 characters", vbOKOnly & vbCritical, "Invalid Username"


Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top