Creating a report for each record

E

Emma

I have set up a report using the fields in my main database into an invoice
design, with the desire to have an invoice for each of my records however
each time i click on the command button from a records form page taking me to
the report, its only ever giving me the details of one of my records, so i
can't have the report (invoice)on the other records. Can anyone help?
 
D

Damon Heron

Sounds like you may have used a wizard to create the click event for the
command button. What is the code?

Damon
 
E

Emma

does this look like the code:

Private Sub Preview_Invoice_Click()
On Error GoTo Err_Preview_Invoice_Click

Dim stDocName As String

stDocName = "Lewisham PDC Publications Invoice 2008-09"
DoCmd.OpenReport stDocName, acPreview

Exit_Preview_Invoice_Click:
Exit Sub

Err_Preview_Invoice_Click:
MsgBox Err.Description
Resume Exit_Preview_Invoice_Click

End Sub

thanks
Emma
 
E

Emma

is this the code?

Private Sub Preview_Invoice_Click()
On Error GoTo Err_Preview_Invoice_Click

Dim stDocName As String

stDocName = "Lewisham PDC Publications Invoice 2008-09"
DoCmd.OpenReport stDocName, acPreview

Exit_Preview_Invoice_Click:
Exit Sub

Err_Preview_Invoice_Click:
MsgBox Err.Description
Resume Exit_Preview_Invoice_Click

End Sub

thanks
emma
 
D

Damon Heron

The button click looks okay, so it must be in the report. Open the report
in design view and look at the record source. It could be restricting the
report to the current record on the form. But the question arises, do you
want all of your records printed each time you call the report? There has
to be some limits on the records invoices printed, or you will be
duplicating invoices over and over. Perhaps you need to restrict the
invoices to a number or date range.

Damon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top