I'm trying to figure out how to produce an error message if the person doesn't enter an actual string when prompted to enter a product code. If they enter the empty string or push okay/cancel without entering the right product code a msgbox is supposed to pop up. I can't figure it out! This is what I have so far.... (ps i'm supposed to use the Do While method)
Dim strInput As String
Dim isEmpty As Boolean
strInput = InputBox("Enter the product code")
isEmpty = True
Do While strInput
If strInput = " " Then
'Or vbCancel Or vbokay Then
isEmpty = True
MsgBox "Please enter an appropriate product code"
End If
Exit Do
MsgBox ("Your product code is " & strInput)
Loop
Please go to http://pastebin.com (or any other web code repository) and paste your code there. Then put the link to your code into a discussion comment back here. The editor for this forum is having trouble with formatting code, and there are a couple points in your program that are very confusing. -- Tom
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply