[AccessD] Limit Text in Field

Jim Lawrence accessd at shaw.ca
Tue Oct 31 11:56:20 CST 2006


Hi Virginia:

Something like this might work:

Dim strText(255) as string
Dim strtemp(255) as string

srText = strText & strTemp

You now have a string of around 512 byte. There is a limit, around 4096 byte
if my memeory serves me well.

HTH
Jim 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hollis, Virginia
Sent: Tuesday, October 31, 2006 4:54 AM
To: accessD at databaseadvisors.com
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




More information about the AccessD mailing list