Tony Septav
iggy at nanaimo.ark.com
Sat Jul 5 09:45:42 CDT 2008
Hey Rocky Thanks for the reply. Basically what I figured. What I figure on doing is using the old Access97 code (it needs modifying) to get the maximum characters for the text box width and multiply that by the number of lines. That way I can first run a check to see what is happening if the user is just simply typing text (no carriage return or line feed). If it passes the test then check and count the number CR and/or LF if they exceed the number of lines -1 then trap it and warn the user. I think that should work. Just didn't want to reinvent the wheel if there was something already out there. rockysmolin at bchacc.com wrote: >Couldn't you just use that code and multiply the number of characters in >one line by the number of lines? > >You'd have to adjust the routine to also count hard returns so that, if you >wanted to restric tthe text box to three lines the user can't enter four >short lines. > >You'vre also got to account for different fonts having different character >widths. > >Interesting problem. Maybe you can post the solution. > >Rocky > > >Original Message: >----------------- >From: Tony Septav iggy at nanaimo.ark.com >Date: Sat, 05 Jul 2008 06:51:11 -0700 >To: accessd at databaseadvisors.com >Subject: [AccessD] Restrict the number of lines in a text box. > > >Hey All >Does anyone know how to restrict the number of lines in a text box? >I found some old Access97 code to restrict the numbers of characters to >the width of the text box. > >Thanks > >