T
Tony Williams
I have 3 controls on a form that I want to lock to make uneditable after
they have been input. I had the Locked property set to yes and this code in
the On Current event
Private Sub Form_Current()
If Me.NewRecord Then
Me.Action_Date.Locked = False
Else
Me.Action_Date.Locked = True
End If
If Me.NewRecord Then
Me.Action_Time.Locked = False
Else
Me.Action_Time.Locked = True
End If
If Me.NewRecord Then
Me.Action_Log.Locked = False
Else
Me.Action_Log.Locked = True
End If
End Sub
It seems to do what I want it to do but when I run Debug I get an error
message that says method or data member not found and Me.NewRecord is
highlighted.
Also although the data is locked in the form view I can still delete the
records from the table. Is there anyway of making the data not deletable.
This is for a database where there is an Action log and we don't want anyone
able to delete or amend the data in the log once it has been input.
Anyone any clues for me?
Thanks
Tony
they have been input. I had the Locked property set to yes and this code in
the On Current event
Private Sub Form_Current()
If Me.NewRecord Then
Me.Action_Date.Locked = False
Else
Me.Action_Date.Locked = True
End If
If Me.NewRecord Then
Me.Action_Time.Locked = False
Else
Me.Action_Time.Locked = True
End If
If Me.NewRecord Then
Me.Action_Log.Locked = False
Else
Me.Action_Log.Locked = True
End If
End Sub
It seems to do what I want it to do but when I run Debug I get an error
message that says method or data member not found and Me.NewRecord is
highlighted.
Also although the data is locked in the form view I can still delete the
records from the table. Is there anyway of making the data not deletable.
This is for a database where there is an Action log and we don't want anyone
able to delete or amend the data in the log once it has been input.
Anyone any clues for me?
Thanks
Tony