macro/report combo question

linwoodrc

Registered User.
Local time
Yesterday, 22:54
Joined
Oct 10, 2003
Messages
17
I have created a Sales Order system and have now come to my first hurdle...I need to Print/Collate multiple reports when I post the orders. Example... Each order has an Original office copy, a Packing slip, a Pick sheet, etc....
Everything is groovy as long as I post 1 order at a time... But if I post multiple orders, it prints all the packing slips, pick sheets,etc... together.
I am using a macro to execute the print out of all the reports.
Is there a way to "step" through one order at a time, printing all pertinant reports for that record, then go to the next...
(Hope I don't sound too dumb...lol)

Thanks,

desperate Dave in KC.... :eek:
 
You'll have to use VBA coding.
What you need to do is to create a recordset and, with a "Do until EOF" loop, read all your records one at a time then print them out. It should look like this (I have done it very fast and didn't test it):
Code:
Private Sub YourButton_Click()
    Dim Rs As Recordset
    Set Rs = Me.RecordsetClone
    Rs.MoveFirst
    Do Until Rs.EOF
        DoCmd.OpenReport "YourFirstReport"
        DoCmd.OpenReport "YourSecondReport"
        DoCmd.OpenReport "YourThirdReport"
        Rs.MoveNext
    Loop
End Sub

I hope it helps you to get started.
 

Users who are viewing this thread

Back
Top Bottom