Applecore Pages on Microsoft Access

Saving a record through code

If you need to force a record to be saved, normally in order that you can then use that record for something, such as being printed in a report, then you have three options available:

  • Using a DoMenuItem method. These have now been effectively replaced in Access 97, and are not automatically replaced when a database is converted between versions.

  • Using DoCmd.RunCmd acCmdSaveRecord

  • Using the Dirty property of the form. This is the recommended method, as you can firstly only force a save if needed, and secondly, you are guaranteed of ensuring that the correct form has its data saved:

    Private Sub cmdSave_Click()
        If Me.Dirty=True Then Me.Dirty=False
    End Sub

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 13:54:05