473,320 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Find the length of text stored in a textbox?

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
2 9543
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: wfs | last post by:
Hi All, I've defined a few functions to DB2. I can see the entries in SYSIBM.SYSROUTINES - but where is the source text stored. I want to reverse engineer the definitions.
2
by: rsquarev | last post by:
Hi, I am getting a problem regarding textboxes. In my application I am using a framework, which provides the page base for my application, It's just designing of page. But by using this I am not...
6
by: =?Utf-8?B?VGFydW4=?= | last post by:
Hi, I have to generate a fixed length text file.I have a file formats like fields details as well as its length and position.what actually i have to do that i will get the data from the databas...
2
by: Edwin.Madari | last post by:
#your thought is right. ======================================================= def sizes2fields(sizes): d = begin = 0 for i in sizes: if begin: end = begin + i else: end = i...
1
by: clem | last post by:
Hello, there is an asp.net textbox which contains some text. <asp:textbox runat="server"></asp:textbox> I select some part of the text with the mouse: how can i get that part of text in a...
8
by: iheartvba | last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file: DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
6
by: aeris | last post by:
Hello, I'm a beginner of using C#. I'm creating a window application, May I know how to clear the default text on textbox when I click directly on the textbox? For example, the txtBox has the...
4
by: aeris | last post by:
Hello! I'm using C# to doing my window application. May I ask, how to write text on textbox after the default text is clear? I have setted the default text in textbox, when a user click on it,...
2
by: polluxsoftech | last post by:
i want to enter text in textbox by dropdown only when clicking on button i want that all this perform at client side by javascript.. this is dont in apsx page but i want it in .ascx this is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.