Printing invoices

  • Thread starter Thread starter Gosha
  • Start date Start date
G

Gosha

Hi there

I have a 'Recrutiment Fair bookings' db.
I use report function to print invoices. However not all of the attendies
need invoices.
I use a button to print preview reports(invoices)
code behind it is:


Private Sub Command88_Click()
On Error GoTo Err_Command88_Click

Dim stDocName As String

stDocName = "Invoice"
DoCmd.OpenReport stDocName, acPreview

Exit_Command88_Click:
Exit Sub

Err_Command88_Click:
MsgBox Err.Description
Resume Exit_Command88_Click

End Sub


Problems I have:
1. When i go to print preview access shows all of the invoices not the one i
've just created
2. When i flick to the one i want to print and click print - it prints all
of them
3. when i select pages to print it prints the page but it looks like the
form not the report....?!

I build this code on the basis of what we have in a general invoice db and
it works there....

Please help

Thanks in advance :)
 
Hi Duane

Thanks for you reply

I hade adapted the vba code to:

Private Sub Command88_Click()
On Error GoTo Err_Command88_Click

Dim strDocName As String
Dim strWhere As String
strDocName = "Invoice"
strWhere = "[Invoice Number]=" & Me!Invoice Number
DoCmd.OpenReport strDocName, acPreview, , strWhere


Exit_Command88_Click:
Exit Sub

Err_Command88_Click:
MsgBox Err.Description
Resume Exit_Command88_Click

End Sub

I am getting a syntax error back :(

Can you see it?
 
Sorry Duane!

my mistake!!!! I got it - the filed name is actually [number] not invoice
number....silly me! its been a long day...

Thank a lot for your help!
 
Back
Top