Keep form from saving

wtrimble

Registered User.
Local time
Today, 11:41
Joined
Nov 13, 2009
Messages
177
I have a subform of a query on a form in my database. Users are allowed to edit the column widths and filter each column if so desired. My problem is that when the user exits the form, I don't want a pop up asking whether you would like to save changes to the layout of the query. I can't figure out how to close the form without saving the sub-form.
I know the "docmd.close acform" command has an argument to close without saving, but I tried that using the subform name and "docmd.close acQuery" and neither work.

Must be an easy solution...

Thanks for any help.
 
I know the "docmd.close acform" command has an argument to close without saving, but I tried that using the subform name and "docmd.close acQuery" and neither work.
Thanks for any help.

try that command in the on close event of the sub form since that is the object they are modifying
 
Only Events available for the subform is "On Exit" and "On Enter"
 
Only Events available for the subform is "On Exit" and "On Enter"

No, open the sub form in the design view, then add the code in the sub forms on close event. Do not open the sub form from within the main form. A sub form is a form, you are just using it within a form.
 
Also making a layout change such as changing the width of a field in a query would also request you save as well. I wonder why your users are given the query? You can represent the same data in form and set it to datasheet view. Easier to catch events, with queries there aren't events.
 
Tried to use the docmd.close command in the actual form like you said but to no avail (sp?). I have a form with a query, comboboxes and checkboxes where the user can look up and filter "Project Numbers" created by Project Managers.

Any other ideas?
 
My problem is that when the user exits the form, I don't want a pop up asking whether you would like to save changes to the layout of the query..
This sounds to me you have a query that opens up and not a form?
 
What is the default view property of your sub form? I would use either Datasheet or Continuous Forms. The latter will give you more options and control over what your users can do with the form which you are using as a sub form within a form. Also, the record source of the sub form should be a query or build the SQL is always my preference.
 
It's in datasheet view. And yes there's an sql compliled for every filter provided.
 
It's in datasheet view. And yes there's an sql compliled for every filter provided.

I suggest that you set the sub form default view property to Continuous Forms. The users can still sort and filter the data by right clicking the data fields.

EDIT: I just played with one of my sub forms in a form design and I do not get any messages about saving the form [sub form] when I alter the size of the fields when the sub form is in datasheet view within a form.
 
Ah, got it. I changed the Source Object from the query to the Query subform. This allows column widths to be changed without saving when exiting. For some reason when you alter a query it will save that way, but not a query subform.

Thanks for the help!
 

Users who are viewing this thread

Back
Top Bottom