May 23, 200520 yr I have chosen to print records from a separate file and offer the Print Setup (Windows) to the user - to offer them a choice of printer. If the user cancels the Print Setup Dialog how can I get him back to his original layout? Hope someone can help.
May 23, 200520 yr Author Thanks for your reply. This stops the Error Dialog (Continue/Cancel) but when I choose to cancel but I still end up with a printed copy because of the Print script step (presumably). That's what I'm trying to avoid so if the user selects the cancel option the script is "stopped" and is then returned to their original layout.
May 23, 200520 yr User cancelled action is Error 1. So... Alow User Abort[off] Set Error Capture[on] Print[] Set Field [ gError, Status( CurrentError ) ] Set Error Capture[off] If [ gError = 0 ] # Print was successful. <stuff to do when print happens> Else If [ gError = 1 ] # User cancelled action. Go to layout[original layout] Else # Some other error has occurred. End If End If I prefer to put the error code into a global number field (gError) so it can be used later (the CurrentError variable gets reset after each script step processes, even comments).
May 24, 200520 yr Now i tried my suggestion in my PC.If understood you truly - it does what you want.See attachment. Press print button, then choose cancel. print.zip
May 26, 200520 yr Alow User Abort[off] Set Error Capture[on] Print[] Go to layout[original layout] ... Now i tried my suggestion in my PC. If I understood you truly - it does what you want. See attachment. Press print button, then choose cancel. Your method above worked perfectly for me. In response to the earlier comment about this method, it does not print after hitting "Cancel" because that "Cancel" button is for printing. (Cancel for the script is suppressed by the steps above.) The script then continues and takes the user back to the original layout. This was short and sweet which is what I needed in my client's office at 2 am. Thanks. The other solution looks great for situations that are more complex than mine.
Create an account or sign in to comment