Hi, I am new to Access and need a little help.

I am trying to lock a single record of a form, after all the members edited the form so nobody can come back to the record and edit after that. But I don't want to lock the database.

Once the form manager clicks the submit button, the first record of the form should lock and then move on to the second record for a new project. I found a couple of codes online but I get error message when I click "Run". Also I'm not sure if I'm connecting the code to the Form right.

Your help will be very much appreciated!!


This is the Code example I was using:


Private Sub Command357_Click()
If Me.NewRecord Or IsNull(Me.DateCompleted) Then


Me.AllowEdits = True

'' if there is a sub form(s) use the following
Me.SubFormName.Locked = False

Else


Me.AllowEdits = False
'' if there is a sub form(s) use the following
Me.SubFormName.Locked = True


End If

End Sub