View Full Version : limiting text


jjohnston
03-12-2000, 05:50 PM
We use Access to report student progress at our school. The teachers love comments so I have built in memo boxes for them to enter comments. I can't find a way to limit the text. A text box only allows 255 characters so I need to use a memo box. Any suggestions will be appreciated
jjohnston

Travis
03-12-2000, 08:26 PM
If you are talking about limiting how many characters can be typed into the Memo box try the following:

Private Sub Text0_Change()
if len(me.text0.text) >255 then
me.text0 = left(me.text0.text,255)
end if

End Sub

this will run a check on the length of the memo field and reset it to the length that you are limiting it to (minus the extra).

jjohnston
03-13-2000, 02:56 PM
Thanks Travis,

Yes I am trying out how to limit characters in a memo box. I tried the code you sent me, but it still allowed me to enter as many characters as I wanted.

Any other suggestions?