If these lines are below the maion 9 line record I assume you are flagging the template as a FOOTER.
Do you always have either one or two lines for these accounts? Are there ever NO ACCOUNTS or more than two lines?
Are there always at least 2 lines , even if one is blank, between the start of what I will call the footer area and the first part of the first template related to the next record?
Are the Account numbers always going to start with CK or SV? (Or something equivalent if that is a dummy reference.)
Assuming for now that there is always at least one record and that you can trap the line cleanly, try this out.
In addition to you detail template edine a footer template and trap on something like the AAN if that makes it unique from the detail records template.
Make the data sample 2 lines long. (If there can be 3 or more accounts this needs to change but let's deal with that if it happens.)
In the first row of the field definition area for the template paint a field where the account number will appear across the row. Right click on the field to get to the properties and click on the advanced tab. In the 'Start Field On' section use 'Preceding String in current Line' option and enter "CK1". Call the field "Checking Account" or something suitable. If some of the account may start CK2 or whatever, just use CK as the preceding string and include the numeric value in the field being created.
On the next line repeat this but use SV as the preceding string.
The footer will now pick up a field for CK where a CK account number exists, SV is an SV number exists and both if they both exist.
If a client has 2 CK or SV accounts you are likely to have a problem. The footer template must have as many rows in the data sample area as there might be account numbers BUT it must NOT exceed the minimum number of rows, including blank rows, from the start row of the footer definition to the first row of the next detail record or append template, if there is one, for the next record.
I hope all of that makes sense. It is a lot easier to do than to describe!
If it does not make sense let me know. Likewiase if it does not work let me know but I would need to know what the problem is in both cases if a further useful suggestion is to mean anything.