How do I program the Cancel button on an input box to stop the macro that the input box is a part of. Below I have two input boxes, and I'd like the macro to stop anytime the cancel buttin is pressed.
sess0.screen.moveto 21,3
sess0.screen.sendkeys("<Tab>audme")
msgtext = "Input the Audit Case Number"
strCaseNumber=InputBox$(msgtext) 'assigns a value to strCaseNumber
sess0.screen.sendkeys strCaseNumber
sess0.screen.sendkeys ("<enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
msgtext = "Input the DATE as DDMMYY"
strDate=InputBox$(msgtext) 'assigns a value to strDate
sess0.screen.moveto 07,02
Sess0.Screen.Sendkeys "COMPLETD"
' sess0.screen.moveto 07,40
Sess0.Screen.Sendkeys strDate
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sess0.screen.sendkeys("<PF9>")
System.TimeoutValue = OldSystemTimeout
End Sub
sess0.screen.moveto 21,3
sess0.screen.sendkeys("<Tab>audme")
msgtext = "Input the Audit Case Number"
strCaseNumber=InputBox$(msgtext) 'assigns a value to strCaseNumber
sess0.screen.sendkeys strCaseNumber
sess0.screen.sendkeys ("<enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
msgtext = "Input the DATE as DDMMYY"
strDate=InputBox$(msgtext) 'assigns a value to strDate
sess0.screen.moveto 07,02
Sess0.Screen.Sendkeys "COMPLETD"
' sess0.screen.moveto 07,40
Sess0.Screen.Sendkeys strDate
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
sess0.screen.sendkeys("<PF9>")
System.TimeoutValue = OldSystemTimeout
End Sub