New Form and Prompt to Save As

RobJen

Registered User.
Local time
Today, 07:47
Joined
Jul 19, 2005
Messages
35
I've been searching for this through out the web and cannot find an answer. I've made a VBA module that creates a new form and places controls on the form. It's ment to be a temp form though and when I try to close, it will prompt me to save the form. There seems to be no way to bypass this.

Another option is to save the form and then delete it but the problem is that it's a multi-user inviroment so there will be a lot of temp forms present e.a.

Form1
Form2
Form3

Can anyone point me into the right direction to do this? To be honest, the whole forced save prompt doesn't make any sense to me, just close the damn thing without changes ><

Thanks in advance!
 
In the code you use to close it:

DoCmd.Close acForm "YourFormName", acSaveNo
 
That doesn't work. The weird thing is, I made a new blank form and then added some elements to it. Then I tried to close it and I got a prompt where I could decide to save or not save.

When I run the script and try to close the form, the only option I get is the form name and:
-Ok
-Cancel

Of course when I cancel, the form is still open and no way to close it unless I save it. Perhaps to elaborate a bit, the form doesn't have name yet actually since all the script did was to create a new form, switch to design then add some controls and go back to form view. Trying to close the form without save then doesn't work anymore. Even trying to exit the application will prompt the save/cancel view and there is no way to quit without saving the form.
 
Last edited:
To duplicate the item I'm talking about, if anyone is wondering, try making a new form then add a control to the form and just try to close or save the form, or close the app for that matter. You will be forced to save the form. I'm looking for any way to bypass this prompt, wether I script it so that it's saved or not.

edit: this doesn't work either


DoCmd.Save acForm, tempfrm
DoCmd.DeleteObject acForm, tempfrm

tempfrm is a public variable that stores the name of the form created with CreateForm()
 
Last edited:

Users who are viewing this thread

Back
Top Bottom