[AccessD] Limit Text in Field

paul.hartland at fsmail.net paul.hartland at fsmail.net
Tue Oct 31 07:05:04 CST 2006


Virgina,
If Len(GstrFileName) > 500 Then

       MsgBox "You must limit the length of the Equipment Used to 500
characters", vbExclamation + vbOKOnly, "Text Too Long"

       ' say your text field is text1, couldn't you put text1 = left(text1,500) 

       Exit Sub

   End If






Message Received: Oct 31 2006, 12:59 PM
From: "Hollis, Virginia" 
To: accessD at databaseadvisors.com
Cc: 
Subject: [AccessD] Limit Text in Field

I need a field that is longer than the 255 txt, but shorter than a memo.
Is there a way to limit the characters entered into a field?



I tried this code on the Before Update, but it still let me type more
than 500 characters. I also remember seeing someone had an example on
limited text and it had a field that showed how many characters were
left to type. Does anyone still have that or know where it can be
located?



'-- File names are limited in length.

If Len(GstrFileName) > 500 Then

MsgBox "You must limit the length of the Equipment Used to 500
characters", vbExclamation + vbOKOnly, "Text Too Long"

Exit Sub

End If



Virginia

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





Paul Hartland 
paul.hartland at fsmail.net 
07730 523179 


More information about the AccessD mailing list