Hello all:
I have two forms (MS Access 2010). The main form allows an end user to select certain materials. Once they select an item and then press 'Process', it the material has serial numbers, it displays the second form (acDialog), so the end user can select the serial numbers they're processing. What I would like to happen is if an end user clicks the x at the top of the second form (the serial number selector), I want all execution to stop. I thought if I create an Err object it would do that, but it throws the error and then continues execution on the main form. Is there a way to completely stop execution of the code?
Many thanks!
Juan
One of the neat things about the acDialog value in the WindowMode is that the code on the main form will pause until you have closed (or hidden) the popup form; the key here is "or hidden"! The way I use this is to place a cancel button on the popup form and hide the form in when that button is clicked. I then use code like the following in the main form.
docmd.OpenForm "frmPopup", acNormal, , , ,acDialog
if currentproject.allforms("f
docmd.close acform, "frmPopup"
Exit sub
endif
'otherwise, continue