none
Why must all SubForms be saved again and again when I just adjusting the Split on the MainForm RRS feed

  • Question

  • Hi

    I guess it is a set up thing, but I cant figure it out.

    I have a MainForm - Split form with datasheet on Right. Each time the user changes the width of the datasheet and thereafter Close the form, he/she is prompted to save not only the change of the MainForm - all Suforms has to be saved too-

    I want to turn off the promted savings of Subforms


    Best // Peter Forss Stockholm GMT +1.00

    Friday, March 30, 2018 7:00 AM

Answers

  • Hi Imb

    I really like the options with a splitter bar on some Forms. So I will try to keep them.

    Now I found a way to have the prompting on saving all the Subforms.

    There is the Form.SplitFormSplitterBarSave Property. Its default “Yes”. I changed it to “No” - and voila - no more Saving of SubForms.


    Cheers // Peter Forss Stockholm


    Sunday, April 1, 2018 9:18 AM

All replies

  • Hi Peter,

    I just created a quick mockup form but did not get any save prompts like you did when I adjusted the column widths of the datasheet either in the split form or the subform.

    Do you have any code executing in the background changing the design/layout of the forms/subforms?

    Friday, March 30, 2018 2:41 PM
  • Hi DB

    There is a code On Close running queries. (Swedish names but they all removes data from SubForm/Tables that is incoplete. Nothing on the design av the Form, nor Main nor SubForms

    Private Sub Form_Close()
    On Error GoTo Form_Close_Err


        DoCmd.OpenQuery "Recept ta bort tomma humlerader", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept ta bort maltrader med Null", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept ta bort jästrader med Null", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept ta bort Tillsatser som är Null", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept ta bort Övriga extrakt Null", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept humlerader uppdatera Gram med Heltal1 x Tal1", acViewNormal, acEdit
        DoCmd.OpenQuery "Recept humlerader uppdatera g/l  med Tal1/Heltal1", acViewNormal, acEdit
        'Recept humlerader uppdatera g/l  med Tal1/Heltal1


    Form_Close_Exit:
        Exit Sub

    Form_Close_Err:
        MsgBox Error$
        Resume Form_Close_Exit

    --- Just as a test I did remove the code above. But the promted savings is still there :-(


    Best // Peter Forss Stockholm GMT +1.00


    Friday, March 30, 2018 4:22 PM
  • Hi 

    An extra line in On Close event changes nothing:

    DoCmd.Close acForm, "[Recept för bryggning]", acSaveYes

    Still prompting Yes or No to savings for all forms Main and Subs.

    Changed the line to:

    DoCmd.Close acForm, "[Recept för bryggning]", acSaveNo

    Still prompting Yes or No to savings for all forms Main and Subs.


    Best // Peter Forss Stockholm GMT +1.00


    Friday, March 30, 2018 4:40 PM
  • Hi Peter,

    Adding acSaveYes or acSaveNo only applies to the form you're closing. Since design changes are somehow being performed on the other subforms, you'll need to address those as well.

    However, just as a test, what happens if you remove all the codes from your form and then try to adjust the width and then close the form using the Red "x" on the top right corner? Will you still get a prompt?

    Friday, March 30, 2018 4:57 PM
  • HI DB

    Even without the code I am promted to say Yes or No to savings. If I click the tab and if I click the "x"

    But when I create a button and add a Macro:

    Close Window

    Object type Form
    Object name "Recept för bryggning"
    Save No

    Then I am not prompted at all.



    Best // Peter Forss Stockholm GMT +1.00


    Friday, March 30, 2018 5:17 PM
  • Unfortunately, this is hard for me to troubleshoot without seeing your form. When I created a new Split Form with a Subform, there were no code in it, and I didn't get a prompt to save any design changes. If you're getting one, then I can only suspect a design change is being made to your form somehow.

    Cheers!

    Friday, March 30, 2018 5:27 PM
  • PS. The only other solution I could think, if you can't find the cause of these design changes and don't want to get the prompts, is to compile your project to ACCDE or use the Runtime version because design changes are not allowed then, so you won't (shouldn't) get a prompt.

    Just my 2 cents...

    Friday, March 30, 2018 5:32 PM
  • Hi DB

    I found the reason. On my SubForm there are two lines. If I remove them theres no more prompting for saving.

    Private Sub Form_Load()
    Me.OrderByOn = False
    Me.FilterOn = False
    End Sub


    Best // Peter Forss Stockholm GMT +1.00

    Saturday, March 31, 2018 4:59 AM
  • I found the reason. On my SubForm there are two lines. If I remove them theres no more prompting for saving.

    Private Sub Form_Load()
    Me.OrderByOn = False
    Me.FilterOn = False
    End Sub

    Hi Peter,

    I do not understand this: setting some properties in the Load event of a form shouls not result in the need for saving the form. I change almost any property of any form without any problem. Only when I use VBE I am asked to save.

    Imb.

    Saturday, March 31, 2018 8:08 AM
  • Hi Imb

    Strange but that was the reason I found.

    I have not used the VBE.


    Cheers // Peter Forss Stockholm

    Saturday, March 31, 2018 10:15 AM
  • Hi Peter,

    Glad to hear you got it sorted out. As I suspected, some sort of code was causing the issue. Good luck with your project.

    Saturday, March 31, 2018 5:12 PM
  • I do not understand this: setting some properties in the Load event of a form shouls not result in the need for saving the form. I change almost any property of any form without any problem. Only when I use VBE I am asked to save.

    I've done a little experimenting, and while it's not conclusive, what I think happens is that Access only checks to see if modified properties need to be saved if you manually -- through the user interface -- make a design change on the form. If you move the splitter bar on a split form, that is taken as a design change made via the UI, and Access then checks to see if any other objects have had design changes -- even design changes made in code -- and prompts to save them. 


    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

    Sunday, April 1, 2018 3:09 AM
  • Hi Dirk

    Thanks for helping. Is there maybe a way to deal with this by code. Like if I move the splitter bar - save all changes? Or ignore changes.

    I mean, the simple macro below closes the Form with no promting:

    Close Window
    Object type Form
    Object name "Recept för bryggning"
    Save No

    I have not found the way to have the same macro clicking Close on Form tab och the "x" of the form


    Cheers // Peter Forss Stockholm


    Sunday, April 1, 2018 5:02 AM
  • Is there maybe a way to deal with this by code. Like if I move the splitter bar - save all changes? Or ignore changes.

    Hi Peter,

    I never use split forms. Probably that is the reason I have never noticed this effect.

    Instead I use different forms (that means the same basic form, but with different properties) to show all kind of related things. would two form, thus without the splitter bar, be an option for you? Communication between forms is really easy.

    Imb.

    Sunday, April 1, 2018 8:16 AM
  • Hi Imb

    I really like the options with a splitter bar on some Forms. So I will try to keep them.

    Now I found a way to have the prompting on saving all the Subforms.

    There is the Form.SplitFormSplitterBarSave Property. Its default “Yes”. I changed it to “No” - and voila - no more Saving of SubForms.


    Cheers // Peter Forss Stockholm


    Sunday, April 1, 2018 9:18 AM
  • Hi Peter,

    I guess this means you weren't really adjusting the widths of the columns in the datasheet; but rather, the width of the datasheet itself by using the splitter bar. Glad to hear you got to the bottom of this. Cheers!

    Sunday, April 1, 2018 4:36 PM