prevent save when closing a form

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
 
C

Carl Rapson

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
 
G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top