prevent save when closing a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
access 2003:
I make a form on the fly with the createForm function.
when the user closes the application I do not want this form to be saved.
Is there a way to prevent the save form dialog for unsaved forms when
closing the application?

regards Rob
 
R.Warning said:
Hi,
access 2003:
I make a form on the fly with the createForm function.
when the user closes the application I do not want this form to be saved.
Is there a way to prevent the save form dialog for unsaved forms when
closing the application?

regards Rob

Can you close the form explicitly with DoCmd.Close and use acSaveNo in the
Save As parameter?

DoCmd.Close acForm, "my form", acSaveNo

Carl Rapson
 
Hi Carl,

the close command acsaveNo isnot working when you close the application
for the "normal closing " off the form (ie. the application stays running.)
it works fine.
 
I found out myself.

first follow the directives in http://support.microsoft.com/kb/300688/en-us
to disable the close and exit functions.

then add a menu item that points to a macro.
in that macro point to a function that closes all forms with the nosave
option and than call 'Application.Quit acQuitSaveNone"

like this:
Public Function closeall()
Dim frm As Form

For Each frm In Application.Forms
DoCmd.Close acForm, frm.name, acSaveNo
Next

Application.Quit acQuitSaveNone

End Function
 
Back
Top