Pusher
BEOGRAD Put
- Local time
- Today, 21:54
- Joined
- May 25, 2011
- Messages
- 230
Hi all,
I want to have an option to lock a particular record (i.e. if an employee leaves, I want to lock their record so that the data can only be viewed but no further changes can be made to it. I know how to lock fields - but that will lock the fields for all records! I want to have an option to only lock certain records. I think I need a check box on my form to achieve this. But again, unfortunately, I’m having difficult of writing the code for this!
I wound this http://allenbrowne.com/ser-56.html but when i do this i lock ALL the records and because its a button i can UNLOCK it again, I want to when pressed it can't be unlocked and that is made for every record separately .
I also made this code
Where NEZAVRSENE_INTERVENCIJE is a check box that can lock the record but when i go to the next record it must be reclicked...
I want to have an option to lock a particular record (i.e. if an employee leaves, I want to lock their record so that the data can only be viewed but no further changes can be made to it. I know how to lock fields - but that will lock the fields for all records! I want to have an option to only lock certain records. I think I need a check box on my form to achieve this. But again, unfortunately, I’m having difficult of writing the code for this!
I wound this http://allenbrowne.com/ser-56.html but when i do this i lock ALL the records and because its a button i can UNLOCK it again, I want to when pressed it can't be unlocked and that is made for every record separately .
I also made this code
Code:
Private Sub NEZAVRSENE_INTERVENCIJE_AfterUpdate()
Dim ctrl As Control
If Me.NEZAVRSENE_INTERVENCIJE = -1 Then
For Each ctrl In Me.Controls
If (TypeOf ctrl Is TextBox) Or (TypeOf ctrl Is CheckBox) Or (TypeOf ctrl Is ComboBox) Then
ctrl.Locked = True
End If
Next
Else
For Each ctrl In Me.Controls
If (TypeOf ctrl Is TextBox) Or (TypeOf ctrl Is CheckBox) Or (TypeOf ctrl Is ComboBox) Then
ctrl.Locked = False
End If
Next
End If
End Sub