This is straight from the VFP Help file for "AfterBand"
"Previous to running OnExit code and triggering the AfterBand event for a Detail or Detail Footer band, the Report Engine has moved the record pointer forward to the next record in the report scope. For information about the order of events in a report run, see Understanding Visual FoxPro Object-Assisted Reporting."
Um ... I consider this a huge bug ... not a "feature" .. but apparently Microsoft doesn't agree with you and I. I have complained about this before but nobody is listening. I just entered another official bug for this. Please feel free to go to this link and add your comments. Maybe if enough of us complain they will fix it.
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=291486In the meantime .. a workaround is to figure out which fields you need in that detail footer band and store them in report variables. At least that way the report variables will still retain the information from the record you are showing totals for .. as opposed to the NEXT record which is really stupid!!
>I've create a report with 4 multiple detail sections. For detail section 3 and 4 variable number of lines can print. If the detail of a section continues on the next page, the page header prints the correct data (current record). If the detail prints on one page, but the total (footer of the detail section) does not fit on the same page, the footer is printed on the next page. Now, this is were I'm stuck... The page header is printed again for the totals, but the data printed is the data of the next record.
>
>How can I get around this?
>
>Thanks