Quote: How about an existing method of creating the merge data file with all the subrecords, and then parsing/editing the data file to remove the lines that are not needed? Any ideas about that?
If you are comfortable with RegEx tools, you might be able to do something like this:
1. Add a new first and last element to the subform records. and fill with a unique value to ID record start and end. Now do the normal export that includes all sub records.
2. Use RegEx on the exported data file to locate unwanted value between those markers, and replace with nothing.
Example, start with this containing all sub records:
"Parent Record elements","Recordheader", "Record1 elements","year=2005","more Record1 elements","RecordTrailer", "Recordheader", "Record2 elements","year=2006","more Record2 elements","RecordTrailer", "Recordheader", "Record3 elements","year=2005","more Record3 elements","RecordTrailer", "Recordheader", "Record4 elements","year=2006","more Record4 elements","RecordTrailer"
Use Regex to look for RecordHeader followed by any data, followed by year=2005, followed by any data, followed by RecordTrailer, and replace that string with nothing. That would result with only having records for year=2006, like this:
"Parent Record elements", "Recordheader", "Record2 elements","year=2006","more Record2 elements","RecordTrailer","Recordheader", "Record4 elements","year=2006","more Record4 elements","RecordTrailer"
Exact RegEx syntax will very depending on what RedEx tools you are using. If you are not familiar with RegEx this may not make much sense, Which reminds me, Mark ...... I have asked about RegEx a few times over the past few years wondering if it would be available to us. Will any RegEx tools be available in Version 2.0?