Forum Discussion

GraemeC_55's avatar
GraemeC_55
Copper Contributor
Mar 22, 2021

MA Accesss save processes

Hello, I will apologise ahead if this topic has been covered elsewhere. I have an MS Access car club membership project, with several tables, that displays basic member information in a main for...
  • George_Hepworth's avatar
    Mar 22, 2021

    GraemeC_55 

    The answers to your questions are, 1) not necessary. and 2) Me.Dirty = False

     

    That said, there are a few additional things to consider beyond the surface questions.


    First, using bound forms, which I assume these are, Access will always save the current record when the form to which it is bound loses focus. In other words, if you are adding or editing a record in the main form, moving the cursor to one of the subforms (i.e. changing focus from the main form to the sub) automatically saves the current record in the main form. No additional saving needed. That can be either desirable or undesirable depending on othe factors, but it is the baseline default behavior.


    Second, this is true, as noted above, of both Main forms and Sub forms when they are bound to tables (or to queries), so again, moving the focus from any one of the subforms to either the main form or to another subform automatically saves that subform's current record. 

     

    If you REALLY want to do your own saves, of course, you can.

    A command button on a form with this code behind does the trick:

     

    Private Sub cmdSAVEME_Click()

        Me.Dirty = False

    End Sub

Resources