I need to output a table and its related tables to a xml file. I am using output/Print # method to do this. My problem is I need to loop through the primary persons table (tblPersons) selecting records that have been flagged for export (chbExportFlag = True). What I can't figure out is how to loop through and grab the addresses (tblAddress) and school names (tblSchools) associated with each person (one to many on PersonID) and insert them into the correct location with the xml file
Here is what my xml needs to look like:
How do I nest a loop within a loop? I tried searching for this and can't find anything on it. Thanks for the help.
Here is what my xml needs to look like:
Code:
<Subject>
<SubjectFirstName>Bob</SubjectFirstName>
<SubjectLastName>Jones</SubjectLastName>
<SubjectDOB>03-15-70</SubjectDOB>
<SubjectAddressSection>
<Address>123 Main St</Address>
<City>Somewhere</City>
<Zip>12345</Zip>
</SubjectAddressSection>
<SubjectAddressSection>
<Address>123 Oak St</Address>
<City>Somewhere</City>
<Zip>12345</Zip>
</SubjectAddressSection>
<Education>
<EducationName>Unversity of NY</EducationName>
</Education>
</Subject>
<Subject>
<SubjectFirstName>Mary</SubjectFirstName>
<SubjectLastName>Smith</SubjectLastName>
<SubjectDOB>12-05-71</SubjectDOB>
<SubjectAddressSection>
<Address>123 Center St</Address>
<City>Somewhere</City>
<Zip>12345</Zip>
</SubjectAddressSection>
<Education>
<EducationName>Unversity of NY</EducationName>
<EducationName>Unversity of Vermont</EducationName>
<EducationName>Unversity of Maryland</EducationName>
</Education>
</Subject>
How do I nest a loop within a loop? I tried searching for this and can't find anything on it. Thanks for the help.