esturgesjr
New member
- Local time
- Today, 00:27
- Joined
- Oct 20, 2025
- Messages
- 9
Greetings, Access gurus! Hoping you can help me sort out what may be a simple issue (and maybe not).
I run a database for my volunteer fire department which is cloud-based. I also run an Access database locally to help me keep track of training that we can't seem to get our vendor to run in their environment. Therefore, I import raw data and run my own queries/reports to track training and certification. Last year we started a Junior program to get kids 14-18 interested in firefighting. OK, enough background. On to my issue.
I have a form (frmJUNIOR_UPDATE) with a subform (JR_TrClassesT) linked by Master (TrnDate, TrnType) to Child (TrnDate, TrnType) ... one to many. I have VBA code in the AfterUpdate of the TrnType field on the main form to populate the JR_ID on the subform, which then has a DLookup to fill the Name field (12 records in total ... or however many Juniors are in our Personnel table).
Here's the VBA:
Everything seems to go smoothly except for the fact that after the code runs (see screenshot attached), the checkboxes are not updateable and I can't figure out why. I tried setting a default value of "0", but that didn't work either.
Hoping someone can pinpoint bad code, bad form or whatever.
Many thanks in advance!
I run a database for my volunteer fire department which is cloud-based. I also run an Access database locally to help me keep track of training that we can't seem to get our vendor to run in their environment. Therefore, I import raw data and run my own queries/reports to track training and certification. Last year we started a Junior program to get kids 14-18 interested in firefighting. OK, enough background. On to my issue.
I have a form (frmJUNIOR_UPDATE) with a subform (JR_TrClassesT) linked by Master (TrnDate, TrnType) to Child (TrnDate, TrnType) ... one to many. I have VBA code in the AfterUpdate of the TrnType field on the main form to populate the JR_ID on the subform, which then has a DLookup to fill the Name field (12 records in total ... or however many Juniors are in our Personnel table).
Here's the VBA:
Code:
Private Sub TrnType_AfterUpdate()
Dim strSQL As String, frm As Form, subfrm As Form
strSQL = "SELECT Personnel.AFD_ID AS JR_ID FROM Personnel WHERE (((Personnel.Rank) = 'Junior Firefighter') And ((Personnel.Status) = 'Active')) ORDER BY Personnel.[Last Name], Personnel.[First Name];"
Set frm = Me
Set subfrm = frm.[JR_TrClassesT subform].Form
subfrm.RecordSource = strSQL
subfrm.Requery
Set subfrm = Nothing
Set frm = Nothing
End Sub
Everything seems to go smoothly except for the fact that after the code runs (see screenshot attached), the checkboxes are not updateable and I can't figure out why. I tried setting a default value of "0", but that didn't work either.
Hoping someone can pinpoint bad code, bad form or whatever.
Many thanks in advance!