E
E.Q.
I have a subform in datasheet view. I'd like to lock the text box named
chrMeasureName for existing records but allow users to enter it in new
records.
I've tried this code
Private Sub Form_Current()
If Me.NewRecord Then
Me.chrMeasureName.Enabled = True
Me.chrMeasureName.Locked = False
Else: Me.chrMeasureName.Enabled = False
Me.chrMeasureName.Locked = True
End If
End sub
This works until chrMeasureName (a text box) is selected in the new record
row and one of the records above is clicked. This generates an error for
trying to disable a control that has focus.
Is it possible to limit edits the way I want. I'm wondering if I can solve
this through error handling or if there's another approach. I thought one
solution would be to have two different forms, one to allow new entries and
another to enter measure descriptions, but I'm hoping there's a more elegant
solution.
Thanks
EQC
chrMeasureName for existing records but allow users to enter it in new
records.
I've tried this code
Private Sub Form_Current()
If Me.NewRecord Then
Me.chrMeasureName.Enabled = True
Me.chrMeasureName.Locked = False
Else: Me.chrMeasureName.Enabled = False
Me.chrMeasureName.Locked = True
End If
End sub
This works until chrMeasureName (a text box) is selected in the new record
row and one of the records above is clicked. This generates an error for
trying to disable a control that has focus.
Is it possible to limit edits the way I want. I'm wondering if I can solve
this through error handling or if there's another approach. I thought one
solution would be to have two different forms, one to allow new entries and
another to enter measure descriptions, but I'm hoping there's a more elegant
solution.
Thanks
EQC