Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count character length at input 1

Status
Not open for further replies.

micang

Technical User
Aug 9, 2006
626
US
Access 2003

Hi All,

I am trying to display the count of characters in a text box into another text box, as the contents is typed in - this is on a form.

I have text box1 and 2:
Test1 - type in contents
Test2 - display character counts as each character is typed

I have tried to put in some code into the OnChange event in Test1 as follows:


Code:
Private Sub test1_Change()
Me.[test2].Text = Len([test1].Text)
End Sub
I get the "can't reference a property or method for a control unless the control has focus"

I would appreciate any guidance on the correct path to achieve this.

Many thanks.

Michael
 
Skip text in test2:

Me.[test2] = Len([test1].Text)
 
Remou, thanks, can't believe how simple it is after all.

Appreciate your assistance.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top