D
DS
I have this Select Case statement that works but I was wondering if
there is a better way to code this. I have ten of these on a number
pad, one for each number 0 to 9,
It takes the first number and places it in a phone format (000)-000-0000
in the first digit as such (100)-000-0000
Then takes the second number and places it as such (110)-000-0000
So on and so forth.
After it places the final digit it stops any further input.
Any suggestions welcome.
Thank You
DS
Select Case Me.TxtCount
Case 10
Case Else
Me.TxtHidden = Me.TxtHidden & 1
Me.TxtCount = Len(Me.TxtHidden.Value)
Dim strX As String
Select Case Me.TxtCount
Case 1
strX = TxtHidden.Value & "000000000"
Case 2
strX = TxtHidden.Value & "00000000"
Case 3
strX = TxtHidden.Value & "0000000"
Case 4
strX = TxtHidden.Value & "000000"
Case 5
strX = TxtHidden.Value & "00000"
Case 6
strX = TxtHidden.Value & "0000"
Case 7
strX = TxtHidden.Value & "000"
Case 8
strX = TxtHidden.Value & "00"
Case 9
strX = TxtHidden.Value & "0"
Case 10
strX = TxtHidden.Value
'Case Else
' MsgBox "Stop"
End Select
Me.LblDisplay.Caption = Format(strX, "(000)-000-0000")
End Select
there is a better way to code this. I have ten of these on a number
pad, one for each number 0 to 9,
It takes the first number and places it in a phone format (000)-000-0000
in the first digit as such (100)-000-0000
Then takes the second number and places it as such (110)-000-0000
So on and so forth.
After it places the final digit it stops any further input.
Any suggestions welcome.
Thank You
DS
Select Case Me.TxtCount
Case 10
Case Else
Me.TxtHidden = Me.TxtHidden & 1
Me.TxtCount = Len(Me.TxtHidden.Value)
Dim strX As String
Select Case Me.TxtCount
Case 1
strX = TxtHidden.Value & "000000000"
Case 2
strX = TxtHidden.Value & "00000000"
Case 3
strX = TxtHidden.Value & "0000000"
Case 4
strX = TxtHidden.Value & "000000"
Case 5
strX = TxtHidden.Value & "00000"
Case 6
strX = TxtHidden.Value & "0000"
Case 7
strX = TxtHidden.Value & "000"
Case 8
strX = TxtHidden.Value & "00"
Case 9
strX = TxtHidden.Value & "0"
Case 10
strX = TxtHidden.Value
'Case Else
' MsgBox "Stop"
End Select
Me.LblDisplay.Caption = Format(strX, "(000)-000-0000")
End Select