Printing invoices

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 :)
 
G

Gosha

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?
 
G

Gosha

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!
 

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