T
Tandy
Hi! I am working on a form and am a little stuck. I would like it if when the
form was opened an input box appears asking my user to enter a PHCO Class.
The PHCO Classes are letters, A, B, C. I have done this sort of code before
to enter quarters. I know that the "IsNumeric" is holding me up because I am
trying to enter letters. Is there an "IsText" to only allow the user to enter
text? Or do I need a new code? Help would be appreciated!
Private Sub Form_Open(Cancel As Integer)
Dim strDefault As String
Dim fGotDefault As Boolean
Do
strDefault = InputBox("Enter the new PHCO Class:")
If Len(strDefault) = 0 Then
fGotDefault = True
Else
If IsNumeric(strDefault) Then
fGotDefault = True
Else
MsgBox "That's not a valid class!"
End If
End If
Loop Until fGotDefault
If Len(strDefault) > 0 Then
Me!PHCOClass.DefaultValue = strDefault
End If
End Sub
form was opened an input box appears asking my user to enter a PHCO Class.
The PHCO Classes are letters, A, B, C. I have done this sort of code before
to enter quarters. I know that the "IsNumeric" is holding me up because I am
trying to enter letters. Is there an "IsText" to only allow the user to enter
text? Or do I need a new code? Help would be appreciated!
Private Sub Form_Open(Cancel As Integer)
Dim strDefault As String
Dim fGotDefault As Boolean
Do
strDefault = InputBox("Enter the new PHCO Class:")
If Len(strDefault) = 0 Then
fGotDefault = True
Else
If IsNumeric(strDefault) Then
fGotDefault = True
Else
MsgBox "That's not a valid class!"
End If
End If
Loop Until fGotDefault
If Len(strDefault) > 0 Then
Me!PHCOClass.DefaultValue = strDefault
End If
End Sub