Counting Textbox Charecters

D

DS

I'm trying to Count the umber of Charecters in a Textbox...
What I would like to do is this...

If TextBox has 1 Character then
Image1.Visible
If TextBox has 2 Charecters Then
Image1.Visible
Image2.Visible
If TextBox has 3 Charecters Then
Image1.Visible
Image2.Visible
Image3.Visible
If TextBox has 4 Charecters Then
Image1.Visible
Image2.Visible
Image3.Visible
Image4.Visible
End If

Any Suggestions Appreciated,
Thanks
DS
 
J

Jeff Boyce

Check the Len() function to determine the number of characters.

Consider using code in the control's AfterUpdate event, something like:

Select Case Len(Me!MyTextControl)
Case 1
'do something
Case 2
'do something else
...
End Select
 
D

DS

Jeff said:
Check the Len() function to determine the number of characters.

Consider using code in the control's AfterUpdate event, something like:

Select Case Len(Me!MyTextControl)
Case 1
'do something
Case 2
'do something else
...
End Select
I tried This and it doesn't work....nothing happens.
Private Sub Display_AfterUpdate()
Select Case Len(Me!Display)
Case 1
Me.Text63.Visible = True
Case 2
Me.Text63.Visible = False
End Select
End Sub
Display is an Unbound Control That has Enabled set to No and Locked Set
to Yes, It's Format is General Number and its populated by Command
Buttons with Values from 0 to 9.
Thanks
DS
 
D

DS

DS said:
I tried This and it doesn't work....nothing happens.
Private Sub Display_AfterUpdate()
Select Case Len(Me!Display)
Case 1
Me.Text63.Visible = True
Case 2
Me.Text63.Visible = False
End Select
End Sub
Display is an Unbound Control That has Enabled set to No and Locked Set
to Yes, It's Format is General Number and its populated by Command
Buttons with Values from 0 to 9.
Thanks
DS
It's Working Now!
Thanks
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top