Sounds like you may have used a wizard to create the click event for the
command button. What is the code?
Damon
>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?
Emma - 13 May 2008 11:26 GMT
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
> Sounds like you may have used a wizard to create the click event for the
> command button. What is the code?
[quoted text clipped - 7 lines]
> > 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?
Emma - 13 May 2008 11:29 GMT
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
> Sounds like you may have used a wizard to create the click event for the
> command button. What is the code?
[quoted text clipped - 7 lines]
> > 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?
Damon Heron - 13 May 2008 17:14 GMT
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
> is this the code?
>
[quoted text clipped - 33 lines]
>> > so i
>> > can't have the report (invoice)on the other records. Can anyone help?