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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel Button Code for an Input Box 1

Status
Not open for further replies.

JRA

Programmer
Apr 19, 2001
106
CA
Hello ...

I'm using an Input Box and I want to write some sort of code that will direct the user to a specific MsgBox if the user clicks on 'cancel'. Currently, when the user clicks on 'cancel', it continues as it would if they had clicked on ok and then later the error message (that I created) pops-up and says used error.

Thanks,
James.
 
According to the help file "If the user clicks Cancel, the function returns a zero-length string ("")." Why don't you test to see if the value is "", and if so, show the msgbox:

strReturn = InputBox(.....)

if strReturn = "" then
msgbox "...."
End if Kathryn


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top