Correct placement of LOOP command
I am having difficulty with a script that includes a loop command. My goal is to get the script to write a classified AD using data from multiple fields from multiple related tables. I've gotten close but continue to fail to get the ad to write correctly.
There is a very specific format to this legal AD. It begins with a standard sentence "AUC 0935861 sells on 1/30/14 at" the variable being the date... then proceeds to find data in related tables to name the time, vin number of a car and then to another related table to get the proper lienholder data as it relates to the record then it should loop back to the next record in the found set to get the time of the next auction, next vin number and lienholder information and loop again until all the records in the found set have been exhausted. It should please the data into the ad in the chronological order of auction times and end.
It seems that I have been able to get it to do the first part but when it loops it's not pulling the time of the next auction or the year make and vin number of the next related record. It does however seem to be pulling all of the lien holder information for all records in the found set.
The result is I get an ad for one Vin number with all lien holders for all records in the found set following... It ignores the hour year make and vin number of the related record.
I have included a screen shot of my work...
Thank you in advance for your help