Am using An inputbox in my form.
If i Press OK the code is fine. When i Press cancel the Program displayin an error. Wat should i Do ?
Am using An inputbox in my form.
If i Press OK the code is fine. When i Press cancel the Program displayin an error. Wat should i Do ?
Change the code that is after the InputBox
to support empty strings. InputBox
will return an empty string if you cancel so the reason for the error must be that your code expects the string to have a lenght > 0.
If you edit the question to show the code that calls InputBox
as well as a few lines following that line, someone can probably point out the exact error.
You should look for an empty string
Dim MyString As String
MyString = InputBox("Please enter something", "Request Info", Nothing)
If (MyString Is Nothing OrElse MyString = "") Then
'User hit cancel
Else
'Read MyString
End If