Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inputbox parameters

Status
Not open for further replies.

autoIT

IS-IT--Management
May 10, 2006
68
US
Here is some of my code, whats wrong with it?

Dim answer As String

Do Until answer = "A" or "B" or "O"
answer = InputBox("Would you like to update A,B, or O time?")
Loop

what is wrong this coding, I thought that is the right way to write it.
 
try this:

Code:
answer = "A" or answer = "B" or answer = "O"


mr s. <;)

 
Your users might find it less ambuguous if you create your own modal popup form with an option group from which to select, but here goes for your current arrangement.

Dim s As String
Do While s <> "A"
s = InputBox("whatever")
Loop


Cheers,
Bill
 
OK one more for you guys

I want to check 2 condition on one line of code:

for ex.

if A=1 and if B=2 then

........


is this right?
 
Looks ok. Have you tried it?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
duh. [blush] And I thought I was looking carefully.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top