save subform changes without prompting on close

abenitez77

Registered User.
Local time
Today, 07:19
Joined
Apr 29, 2010
Messages
141
I have a subform that I move columns around and change from bold to normal font. When I close the main form, it prompts me if I want to save the subform. I don't want it to prompt me, I just want it to save by default. How can i do this?
 
Hi

Why do you need to move Controls and Change Fonts ??

Rearranging Controls and changing Fonts is normally achieved in the Final Report Output and NOT on the Data Input of a Form.
 
The user moves the columns around to their liking. I changed the font of a random column to bold and then back to normal to trigger the save prompt.

Do you know how to default to saving without it prompting me to save when the form is closing when i click on the X ?
 
on the Unload Event of the Main Form:
Code:
Private Sub Form_Unload(Cancel As Integer)
    DoCmd.Save acForm, Me.Name
End Sub
 
I have a form with several subforms... It can be any subform that the user is changing the columns on. When i run this from the parent form:

DoCmd.Save acForm, sFormName

I get error #2489
 
that's exactly what I have. I have a table that records the column orders and when the form opens it checks to see if the order is set and will set it to the last saved settings. But the order is set each time because any change gets recorded but does not save on the form. When the form closes, the column order gets lost.

So, does anyone know how to save the column order in the subform, so that any changes to the order of the subform gets saved and does not need to get reset each time the form opens?
 
Access has not saved column order and column width changes made in form view for several versions.

ColumnOrder and ColumnWidth save for me on datatsheet forms.

A2010 on an mdb file.
 
The .mdb was replaced by .accdb TEN years ago. Just sayin' :)

I know, but accdb brought nothing of any real consequence and took away the capability of digitally signing the code itself.

..... and apparently the saving of the ColumnWidth and ColumnOrder too?
 
Well I suspect I've missed the essence of the question, or got the wrong end of the Stick! Just to say that I've got MS Access 2013 and I can change the column width and column order in datasheet view in a subform (That is to say a form in datasheet view housed on a main form) then close the main form, reopen it and I can see the changes were stored. If I open the datasheet form standalone, (that is not as a subform on a main form) I can change the column order and widths and they are saved. The changes are also kept, and appear when I open the main form which houses this subform.
 
Use the name of the main form and nit yhe name of any subform

Docmd.save acform, "mainformname"
 
Use the name of the main form and nit yhe name of any subform

Docmd.save acform, "mainformname"

This does not provide an error msg but it does not save the column changes. Thanks!

I guess there is no way of saving the column changes of a subform. Currently I am saving the changes to a table and then when form loads it is moving the columns to the saved settings. When the form closes it reverts back to what it is defaulted to. I was hoping to avoid loading the form each time unless necessary.
 
@OP,

Is the database split and does each user have their own front end?

If yes, you will want to save the changes to a data file and restore them each time the user opens the form. This allows you to keep changes when you update the front end.

If not, how do you make sure one users changes don't affect others?
 

Users who are viewing this thread

Back
Top Bottom