jamescol
06-04-2004, 03:53 PM
OK - I've just hit a wall wiht something that should be simple :(
From an InputBox statement, I need to determine whether the user:
1. Clicked OK but did not enter anything
2. Clicked OK but did not enter a sufficient number of characters
3. Clicked Cancel
Here is how I have been trying to write the code:
strInput = InputBox("Enter something greater than 6 characters.")
Select Case strInput
'Check for a blank entry
Case (Len(strInput) = 0)
MsgBox "You must enter something."
'Check that the user entered the minimum length
Case (Len(strInput) < 6)
MsgBox "Your entry must be contain at least 6 characters"
'Check if the user pressed Cancel
Case ""
Exit Function
'If we get here, the string passes
Case other
Msgbox "Good job, you can follow directions!"
End Select
I'm sure the problem is simple. Ideas on what I'm doing wrong?
Thanks,
James
From an InputBox statement, I need to determine whether the user:
1. Clicked OK but did not enter anything
2. Clicked OK but did not enter a sufficient number of characters
3. Clicked Cancel
Here is how I have been trying to write the code:
strInput = InputBox("Enter something greater than 6 characters.")
Select Case strInput
'Check for a blank entry
Case (Len(strInput) = 0)
MsgBox "You must enter something."
'Check that the user entered the minimum length
Case (Len(strInput) < 6)
MsgBox "Your entry must be contain at least 6 characters"
'Check if the user pressed Cancel
Case ""
Exit Function
'If we get here, the string passes
Case other
Msgbox "Good job, you can follow directions!"
End Select
I'm sure the problem is simple. Ideas on what I'm doing wrong?
Thanks,
James