I am trying to lock a specific field in a row. When I do manage to locked the field it locks the whole entire column. Below is a screenshot and some code attached to some of the check boxes so that you can see the variable names I am using.
--------------------------------------------------------------------------------------------------------------------------
Private Sub Returned_Click() '***********************************'
If IssuedLearner.Value = False Then 'This code will set the checkbox of return to empty if no book issued with a message'
MsgBox "No book issued"
Returned.Value = False
Exit Sub
End If
If Returned.Value = True Then
Total_in_Store = Total_in_Store + 1 'When stock increase Issued decrease and vice versa
Issued = Issued - 1
DateReturned.Value = Date ' Setting return date
Else
Total_in_Store = Total_in_Store - 1 'When stock decrease Issued increase and vice versa
Issued = Issued + 1
DateReturned.Value = Null ' Setting return date to empty
End If
End Sub
Private Sub StudentBookIssue_ID_AfterUpdate()
If (StudentBookIssue_ID.Value = True) And (IssuedLearner.Value = False) Then
IssuedLearner.Value = True
Total_in_Store = Total_in_Store - 1 'When stock decrease Issued increase and vice versa
Issued = Issued + 1
DateIssued.Value = Date
End If
If IsNull(StudentBookIssue_ID) Then
IssuedLearner.Value = False
DateIssued.Value = Null
Total_in_Store = Total_in_Store + 1 'When stock decrease Issued increase and vice versa
Issued = Issued - 1
End If
--------------------------------------------------------------------------------------------------------------------------
Private Sub Returned_Click() '***********************************'
If IssuedLearner.Value = False Then 'This code will set the checkbox of return to empty if no book issued with a message'
MsgBox "No book issued"
Returned.Value = False
Exit Sub
End If
If Returned.Value = True Then
Total_in_Store = Total_in_Store + 1 'When stock increase Issued decrease and vice versa
Issued = Issued - 1
DateReturned.Value = Date ' Setting return date
Else
Total_in_Store = Total_in_Store - 1 'When stock decrease Issued increase and vice versa
Issued = Issued + 1
DateReturned.Value = Null ' Setting return date to empty
End If
End Sub
Private Sub StudentBookIssue_ID_AfterUpdate()
If (StudentBookIssue_ID.Value = True) And (IssuedLearner.Value = False) Then
IssuedLearner.Value = True
Total_in_Store = Total_in_Store - 1 'When stock decrease Issued increase and vice versa
Issued = Issued + 1
DateIssued.Value = Date
End If
If IsNull(StudentBookIssue_ID) Then
IssuedLearner.Value = False
DateIssued.Value = Null
Total_in_Store = Total_in_Store + 1 'When stock decrease Issued increase and vice versa
Issued = Issued - 1
End If