473,388 Members | 1,400 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,388 software developers and data experts.

No of chars in a text field

Hi

I am trying to display the no of characters in a text field while user is
typing them. I am using the onchange event as follows;

Private Sub mytextfield_Change()
Me.chars = Str(Len(Me.mytextfield)) & " Characters"
End Sub

However it does not work as the field is actually not committed at this
stage. Is there a way to do this?

Thanks

Regards
Nov 12 '05 #1
2 1415
You can do it if you use the .Text property

Private Sub mytextfield_Change()
Me.chars = Len(Me.mytextfield.Text & "") & " Characters"
End Sub

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:3f**********************@news.dial.pipex.com. ..
Hi

I am trying to display the no of characters in a text field while user is
typing them. I am using the onchange event as follows;

Private Sub mytextfield_Change()
Me.chars = Str(Len(Me.mytextfield)) & " Characters"
End Sub

However it does not work as the field is actually not committed at this
stage. Is there a way to do this?

Thanks

Regards

Nov 12 '05 #2
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:3f**********************@news.dial.pipex.com. ..
Hi

I am trying to display the no of characters in a text field while user is
typing them. I am using the onchange event as follows;

Private Sub mytextfield_Change()
Me.chars = Str(Len(Me.mytextfield)) & " Characters"
End Sub

However it does not work as the field is actually not committed at this
stage. Is there a way to do this?

Thanks

Regards

Use Me.Mytextfield.Text

When you use Me.mytextfield you are in fact referring to the default
property me.mytextfield.value which is the last saved data for the control.
While the control is being edited you can use me.mytextfield.text which
contains the data currently in the control.

HTH
Fletcher
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff | last post by:
A client showed me this one. In a totals query that counts items and links to a parent record, what should be the output from a memo field shows up as Chinese characters - I kid not. He has a...
5
by: Alex | last post by:
Hi all - Is there a standard way to handle special chars in strings in dotnet? I'm using csharp and having two seperate problems... 1. Passing in args... I need to pass in an arg that...
5
by: MLH | last post by:
I'm using A97 import data wizard to import text file N2 a table. The text file is a DIR listing produced by running dir jdc*.* /s c:\JDCs.txt The wizard is chopping the lines off at the...
3
by: Kevin Blount | last post by:
I'm putting a radG:GridTemplateColumn together (which is probably irelevant), and within it I'm using a Label, as so: <asp:Label ID="defaultDescription" runat="server" Text='<%#...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.