inputbox - cancel button

  • Thread starter Thread starter fedum
  • Start date Start date
F

fedum

Maybe often asked but is ther an easy way to know if the
cancelbutton has been clicked. Because I would like to end
the procedure.
Thanks,
Marc
 
put code in the "on click" event of the cancel button...dead giveaway that
the button was clicked.
 
fedum said:
Maybe often asked but is ther an easy way to know if the
cancelbutton has been clicked. Because I would like to end
the procedure.
Thanks,
Marc

There is no difference on an InputBox between the user pressing OK with no entry
and pressing Cancel. In Both cases the InputBox function returns a zero-length
string ("").
 
I can get the string input and see if it is "" (empty or
blank). Is there a way to determine which button was
pressed. My idea is that if the user hits [esc] or
presses "cancel" then I want to stop this portion of the
application. If they hit [enter] without putting data in
(sometimes they are too quick/impatient on the keyboard or
mouse) I want to re-prompt them for input.

Thanks,
JohnV
 
My idea is that if the user hits [esc] or
presses "cancel" then I want to stop this portion of the
application. If they hit [enter] without putting data in
(sometimes they are too quick/impatient on the keyboard or
mouse) I want to re-prompt them for input.

Put a default value in first: if the user bothers to delete it and then OK,
then I guess he means it.

Tim F
 
Thanks for the reaction,
I have put a default value in the inputbox *, if the users
chooses the Cancel button then its an empty string else
the default value and I end the procedure
Marc
-----Original Message-----
My idea is that if the user hits [esc] or
presses "cancel" then I want to stop this portion of the
application. If they hit [enter] without putting data in
(sometimes they are too quick/impatient on the keyboard or
mouse) I want to re-prompt them for input.

Put a default value in first: if the user bothers to delete it and then OK,
then I guess he means it.

Tim F

.
 
Back
Top