security - How to lock Access 2010 record after it has been saved?

07
2014-07
  • JLloyd

    How can I create a macro to permanently lock a record once it has been saved?

    My problem: Every Access 2010 lock command that makes the saved records un-editable, also locks the 'New Record' form fields, so that no new record can be added to the database. I need to lock what has been saved, and at the same time keep adding new records.

    Thanks!!!

  • Answers
  • nixda

    Since you are asking for a VBA solution, you should use DoCmd.OpenTable and acAdd as datamode property

    Sub AddOnlyMode()    
        DoCmd.OpenTable "table1", acViewNormal, acAdd    
    End Sub
    

    If you execute it, an existing table called "table1" will be opened. You won't see old existing entries. You could only add new entries and edit them too as long as you don't close the table.

    Once you have closed the table (saving isn't enough), your entries are locked. Opening the table again via VBA won't show any entries.


  • Related Question

    How to toggle between views in Access 2010
  • Paul Jackson

    I have a form which displays count sheets. One view is with the pre-count qty and the other is without the pre-count qty. This was originally developed in Access 2003. I can not toggle between the two views in Access 2010>


  • Related Answers
  • Nicu Zecheru

    From File menu you can choose between Form View and Layout View

    enter image description here