Do Loop Issue. Please help

Hi,

I am not sure what to do. I am trying to put in a loop if there is no value entered but I am not getting anywhere. Please advice. I am not sure how to use the loop method.


Do
    strAnswer = InputBox _
                ("Please Enter Test Number:", "Enter Test Number")
    If strAnswer = "" Then
      Wscript.Echo "You Must Enter A Test Number."
    Else
Loop while strAnswer = ""
Else

Thanks in advance,
Vicki
Vicki05Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Do
    strAnswer = InputBox _
                ("Please Enter Test Number:", "Enter Test Number")
    If strAnswer = "" Then
      Wscript.Echo "You Must Enter A Test Number."
   ' Else
    End If
Loop while strAnswer = ""
'Else ' Not sure why this is here

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fred MarshallPrincipalCommented:
I don't know VB that well but I'd have to wonder why you need both the test and the loop?

Aren't the DO and the LOOP part of the same structure?
If so, why have the Else?

I guess that amounts to the same thing....
0
Vicki05Author Commented:
Thanks for the solution
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.