Gerbers404
Programmer
Good morning,
I'm having problems trying to enable/disable a specific command button on a subform. I want the command button to check the contents of a field in a record on the subform, insert the date if the field is null, and then disable the command button. Here is what I have so far, tied to the onClick event of the command button on the subform.
Unfortunately, this code disables the command button in every record of the subform, and I only want it to disablle the one in the current record.
Is there a way to do this?
Thanks!
Gerbers404
I'm having problems trying to enable/disable a specific command button on a subform. I want the command button to check the contents of a field in a record on the subform, insert the date if the field is null, and then disable the command button. Here is what I have so far, tied to the onClick event of the command button on the subform.
Code:
If IsNull(Me!FollowUpDate) = False Then
MsgBox "Date has already been entered and cannot be changed.", vbOKOnly, "Field Locked"
Me!FollowUpBy.SetFocus
Me!cmdMarkFollowUp.Enabled = False
Else
Me![FollowUpDate] = CDate(Date)
Me!FollowUpBy.SetFocus
Me!cmdMarkFollowUp.Enabled = False
End If
Unfortunately, this code disables the command button in every record of the subform, and I only want it to disablle the one in the current record.
Is there a way to do this?
Thanks!
Gerbers404