By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Find the length of text stored in a textbox?

P: n/a
Hi all!

How can i find out the length of text stored in a textbox on a form?

I have one textbox which updates a second textbox. But max characters
for a field in a table is 255.

Therefore is wish to able to say

if textbox1.lenght of text + textbox2.lenght of text does not equal
255 then

Write text into textbox2

else

"The textbox is full"
Cheers

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Len(Forms!frmName!ctrlName.Value)

<si************@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi all!

How can i find out the length of text stored in a textbox on a form?

I have one textbox which updates a second textbox. But max characters
for a field in a table is 255.

Therefore is wish to able to say

if textbox1.lenght of text + textbox2.lenght of text does not equal
255 then

Write text into textbox2

else

"The textbox is full"
Cheers

Nov 13 '05 #2

P: n/a
The command you need is the len() command.

Try a google search for 'text string length visual basic'....I got a few
good results.

The following is very useful when it comes to best-practice:
http://www.aivosto.com/vbtips/stringopt.html

Hope that helps,

John

<si************@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi all!

How can i find out the length of text stored in a textbox on a form?

I have one textbox which updates a second textbox. But max characters
for a field in a table is 255.

Therefore is wish to able to say

if textbox1.lenght of text + textbox2.lenght of text does not equal
255 then

Write text into textbox2

else

"The textbox is full"
Cheers

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.