Toggle button.

Tried, but now shows button Record Locks and when i press it, its just activate...and sometimes show Unlock Records. But still not working. Some stupid bug.
 
It looks like you've changed the caption of the button BACK to Record Locks haven't you?
 
No, really i didnt touch nothing. I try even deleted all previous db and download again ur's one.
 
The one I posted is the same db as the one you posted so obviously both would be corrupt.

In the new db shell, import all your tables and queries, but don't import your forms or macros.

Create a new form with just that button and move the code there.
 
I created new db, imported Tables only, than created Toggle button and pasted code:

Code:
Private Sub cmdLockRec_Click()
    If Me.cmdLockRec.Caption = "Lock Records" Then
        Me.AllowAdditions = False
        Me.AllowDeletions = False
        Me.AllowEdits = False
        Me.cmdLockRec.Caption = "Unlock Records"
    Else
        Me.AllowAdditions = True
        Me.AllowDeletions = True
        Me.AllowEdits = True
        Me.cmdLockRec.Caption = "Unlock Records"
    End If
End Sub

Button Caption is Lock Records and Name cmdLockRec.

And i still get the same. Sometimes it happens to Lock all records and i cant Unlock them.
 
Tried that one and i can still type while is pressed down.

Also i get this error. (pic is in the file)
 

Attachments

  • error.PNG
    error.PNG
    11.7 KB · Views: 91
Last edited:
Hello,
I followed allenbrowne steps and it is working great. tk you.:)
Could you explain a little bit more what do you mean by "Lock individual records"?
Just to see if I can help you.
 

Users who are viewing this thread

Back
Top Bottom