Move to Next Detail Record on Report (1 Viewer)

Adam Caramon

Registered User
Local time
Today, 02:05
Joined
Jan 23, 2008
Messages
822
Hi all,

I'm trying to find how to programatically move to the next detail record on a report.

Pseudocode:

Open two recordsets (Old record, Current record)
Compare old to new, if changes, mark up current report record.
Move to next detail section
Loop

But I can't seem to force the report to move to the next detail section, which results in the report always showing only one record.

Thanks in advance,

-Adam.
 

Orthodox Dave

Home Developer
Local time
Today, 07:05
Joined
Apr 13, 2017
Messages
218
Hi Adam,

I see no-one has answered this thread and I think it's because it's lacking in detail, so people aren't sure what you are asking.

It looks to me that you are talking about a report based on a recordset (or two).

There has to be a master table or recorset to move through and manipulate as you come to each record. So to use your analogy:
Open two recordsets (Old record, Current record) [or 3 perhaps?]

With [master recordset]

.movefirst
For Each [Unique field, ID or whatever] In [master recordset]
Compare old to new, if changes, mark up current report record.
Next [Unique field, ID or whatever]

End With

[master recordset].close
set [master recordset] = Nothing
It's always a good idea in debugging to seed your code with message boxes that give you the current state of affairs as you move through the lines of code. Then when it works you can comment them out or delete them.
 

Adam Caramon

Registered User
Local time
Today, 02:05
Joined
Jan 23, 2008
Messages
822
It looks to me that you are talking about a report based on a recordset (or two).

Hi Dave,

Not exactly - I was hoping to have an unbound report that I could create the records for on-the-fly through coding.

As I was unable to find a suitable answer to accommodate that thought, I've instead decided to append records to a local table through code, then base the report off of the local table.

Not sure that's the best way, but it seems to work for this immediate need.

Thanks for your reply,

-Adam
 

Users who are viewing this thread

Top Bottom