InputBox Cancel

  • Thread starter Thread starter Joe Delphi
  • Start date Start date
J

Joe Delphi

Hi,

How can I detect if the user pressed the OK button or the Cancel
button when I use the InputBox function?

JD
 
How can I detect if the user pressed the OK button or the Cancel
button when I use the InputBox function?

You can't do it reliably. If the user clicked the Cancel button, the
function will return a zero-length string. But if the user clicks okay
when there is nothing entered in the box, you'll also get a zero-length
string back. I'd suggest you use logic that interprets a ZLS return
value as a cancel, regardless of what the user did to send it back to
you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top