I agree with Azra,
Except I would put it in a loop
ie
Dim strReturn as string
Dim lngLC as long
strReturn = ""
strReturn = InputBox(.....)
do (while len(strReturn) <= 0 or len(strReturn) > 100) and lngLC < 3
lngLc = lngLC + 1
strReturn = InputBox(.....) 'include messgae to say previous input was bad
loop
if len(strReturn) <= 0 or len(strReturn) > 100 then
exit sub
end if
Main Topics
Browse All Topics





by: AzraSoundPosted on 2006-10-09 at 19:17:57ID: 17695345
I'm sure there is some way that is very complex, but why not just test the length after returned for validity, e.g.,
strReturn = InputBox(...)
If Len(strReturn) > 100 Then
MsgBox "Too long..."
Else
'process
End If