frosty2000
Technical User
Hello,
I have created a subform ("Dependent Demographics") linked to a main form ("Employee Demographics") to track employee and dependent details (date of birth, address, etc.)
In my subform, I have a field titled "Record Type" where the user can select "S" for spouse or "D" for dependent. Based on the selection in this field, I would like to disable/enable a checkbox titled "FTS" (which stands for full-time student). Obviously, a spouse would never be a full-time student, so if "S" is selected, I want to disable the checkbox. But if "D" is selected, I want to enable it.
I would prefer to keep my subform in datasheet view (so that the user can view all spouse/dependent details at once). I have created a code that will disable/enable these fields, but the problem is that it disables/enables ALL records in the subform, and I only want it to disable/enable the individual record. Is this possible?
Here's the code...
Private Sub Record_Type_AfterUpdate()
If [Record Type] = "D" Then
FTS.Enabled = True
Else
FTS.Enabled = False
End Sub
Thanks!
Frosty2000
I have created a subform ("Dependent Demographics") linked to a main form ("Employee Demographics") to track employee and dependent details (date of birth, address, etc.)
In my subform, I have a field titled "Record Type" where the user can select "S" for spouse or "D" for dependent. Based on the selection in this field, I would like to disable/enable a checkbox titled "FTS" (which stands for full-time student). Obviously, a spouse would never be a full-time student, so if "S" is selected, I want to disable the checkbox. But if "D" is selected, I want to enable it.
I would prefer to keep my subform in datasheet view (so that the user can view all spouse/dependent details at once). I have created a code that will disable/enable these fields, but the problem is that it disables/enables ALL records in the subform, and I only want it to disable/enable the individual record. Is this possible?
Here's the code...
Private Sub Record_Type_AfterUpdate()
If [Record Type] = "D" Then
FTS.Enabled = True
Else
FTS.Enabled = False
End Sub
Thanks!
Frosty2000