Question about input boxes

hammerva

Registered User.
Local time
Today, 14:03
Joined
Dec 19, 2000
Messages
102
Hello again. :)

Is there a property or event in an input box to let you know if the user hit the 'Cancel' or 'OK' button? I want to put an edit on a form that makes sure the user enters a value if they hit the 'OK' button.

Oh not to be a jerk, but can we get more smilies. I love those things.
 
from help:

If the user clicks Cancel, the function returns a zero-length string ("").


Use an IF statement to catch the error and re-run the list box. You must also put an exit option in to allow the user to get out of the loop
 
I'm sorry to tell you...

But when the Cancel-button is pressed on an Inputbox, the function returns a string with length 0 (""), and that's the same as when the user didn't give in something and pressed OK.

Maybe you can do something with the argument 'DefaultValue'?
 
Oh I see we were here at the same time, Fornation :D :D

In addition to your loop:
Code:
Do Until Inputbox("Give value") <> ""
  MsgBox "You must give in a value!"
Loop
 

Users who are viewing this thread

Back
Top Bottom