Pusher
BEOGRAD Put
- Local time
- Today, 21:50
- Joined
- May 25, 2011
- Messages
- 230
Hi all,
I need your help with partial locking of a record. This is the situation when there is a shift change and one record is started by one person and finished by another. What one has written another can’t change but must finished a record. So u must lock only the combo boxes and text boxes that are filled. This code lockes all the combo boxes and text boxes and 2 check boxes (NEZAVRSENE_INTERVENCIJE and IZMENA_RASKRSNICE) by clicking on a NEZAVRSENE_INTERVENCIJE check box. Lets say I have combo boxes 1 2 and 3 and text boxes 1 2 and 3 and I have to lock only the ones that are filled. How do I code that another check box lockes just the filled controls?
Thanks
I need your help with partial locking of a record. This is the situation when there is a shift change and one record is started by one person and finished by another. What one has written another can’t change but must finished a record. So u must lock only the combo boxes and text boxes that are filled. This code lockes all the combo boxes and text boxes and 2 check boxes (NEZAVRSENE_INTERVENCIJE and IZMENA_RASKRSNICE) by clicking on a NEZAVRSENE_INTERVENCIJE check box. Lets say I have combo boxes 1 2 and 3 and text boxes 1 2 and 3 and I have to lock only the ones that are filled. How do I code that another check box lockes just the filled controls?
Thanks
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 (ctrl Is NEZAVRSENE_INTERVENCIJE) Or (ctrl Is IZMENA_RASKRSNICE) 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 (ctrl Is NEZAVRSENE_INTERVENCIJE) Or (ctrl Is IZMENA_RASKRSNICE) Or (TypeOf ctrl Is ComboBox) Then
ctrl.Locked = False
End If
Next
End If
End Sub