Create an unbound form and open it as acDialog before the code runs and
then close it when the code completes. You'll want to be certain that
you've got error handling in place and close the form in the event of an
error otherwise your users might get stuck if the code craps out. You
may also want to add an AutoKeys macro that will close the form on
demand since the property settings will not give the user (or you) a
means of closing the form. WARNING - If you open the form without the
AutoKey macro, you'll have to shut down Access to close it.
To lock out the users closing the form manually, use the following
properties
..Modal TRUE
..BorderStyle THIN
..ControlBox NO
..PopUp TRUE
..AutoCenter TRUE
You can also go so far as to put an unbound control on the form to
provide updates to the user to advise them of the progress and/or given
them a progress bar. The code for the advisory is simple. In the sub at
key points, add the following code
Set frm = Forms("frmAdvisory")
frm.txtAdvisory = "Deleting records..."
frm.repaint
frm.txtAdvisory = "Cleaning up tables..."
frm.repaint