Counting Textbox Charecters

  • Thread starter Thread starter DS
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top