Toggle RecordLocks (1 Viewer)

Angello Pimental

Registered User.
Local time
Today, 07:21
Joined
May 9, 2001
Messages
92
How can I create a toggle button that will allow a user to lock or unlock the record for editing??

Does anyone know??
 

KevinM

Registered User.
Local time
Today, 07:21
Joined
Jun 15, 2000
Messages
719
Rich, but that won't toggle back to AllowEdits=False.

Angello try this....

Create a cmdButton and put "LOCK RECORDS" in it's Caption. Then use this OnClick Event

cmdbutt_Click()
If cmdbutt.Caption="LOCK RECORDS" Then
Me.AllowEdits=False
cmdbutt.Caption="UNLOCK RECORDS"
Else
Me.AllowEdits=True
cmdbutt.Caption="LOCK RECORDS"
End If

HTH
 

Angello Pimental

Registered User.
Local time
Today, 07:21
Joined
May 9, 2001
Messages
92
The command button works in that it toggles between LOCK RECORD and UNLOCK RECORD... but you can still edit the record no matter when...
What am I doing wrong?
 

Angello Pimental

Registered User.
Local time
Today, 07:21
Joined
May 9, 2001
Messages
92
Ignore my post before..... I have changed the cmdbutton to UNLOCK instead of LOCK...
It works to the point that I can't edit the record until I push UNLOCK..then I can edit. Put once I push LOCK..it does not lock...
What else do I need to do?
 

KevinM

Registered User.
Local time
Today, 07:21
Joined
Jun 15, 2000
Messages
719
Sorry missed out Me.Refesh...


If cmdbutt.Caption = "LOCK RECORDS" Then
Me.AllowEdits = False
cmdbutt.Caption = "UNLOCK RECORDS"
Me.Refresh
Else
Me.AllowEdits = True
cmdbutt.Caption = "LOCK RECORDS"
Me.Refresh
End If

HTh
 

Users who are viewing this thread

Top Bottom