Problem with record in 1-to-many
Hi Everyone -
I have a form that has multiple tabs on it with each tab containing a different subform. One subform deals with ADA compliance and has a locked checkbox field that is to show when all aspects of compliance are met called chkFullComp. Basically, there are 6 individual fields across 3 subforms that must be checked in order for the main full compliance box to be checked. The code to check for this is done with the 'On Current' event of the main form called frmMain.
I basically used an If - And - Then - Else statement to search throught the other subforms and see if each record meets the standard for full compliance. If each field mets the standard then the code fills in the chkFullComp box. Simple enough....
Now - the problem that I have run into is that two of the subforms are built on 1 to many relationships with the main form since they can contain more that one record for each site. The problem that occurs is that those sites where there are more than one record if at least one of the linked records meets ADA standards then that is ok for Full compliance HOWEVER, the code fails to recognize the other records and only looks at the first record SO it tells me that site isn't compliant when i can see in the subform it is (viewing subform as datasheet). QUESTION - how do I make it check the other records in the 1 to many relationship?
DO I need a loop? (Not real familar with its use)
Thanks in advance for any and all help on this!
Kevin
Hi Everyone -
I have a form that has multiple tabs on it with each tab containing a different subform. One subform deals with ADA compliance and has a locked checkbox field that is to show when all aspects of compliance are met called chkFullComp. Basically, there are 6 individual fields across 3 subforms that must be checked in order for the main full compliance box to be checked. The code to check for this is done with the 'On Current' event of the main form called frmMain.
I basically used an If - And - Then - Else statement to search throught the other subforms and see if each record meets the standard for full compliance. If each field mets the standard then the code fills in the chkFullComp box. Simple enough....
Now - the problem that I have run into is that two of the subforms are built on 1 to many relationships with the main form since they can contain more that one record for each site. The problem that occurs is that those sites where there are more than one record if at least one of the linked records meets ADA standards then that is ok for Full compliance HOWEVER, the code fails to recognize the other records and only looks at the first record SO it tells me that site isn't compliant when i can see in the subform it is (viewing subform as datasheet). QUESTION - how do I make it check the other records in the 1 to many relationship?
DO I need a loop? (Not real familar with its use)
Thanks in advance for any and all help on this!
Kevin
Last edited: