Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable/Enable Checkbox on Subform Records

Status
Not open for further replies.

frosty2000

Technical User
Feb 5, 2005
18
US
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
 
Do what you need to in the OnCurrent Event.

-Laughter works miracles.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top