A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Printing invoices



 
 
Thread Tools Display Modes
  #1  
Old August 4th, 2009, 02:19 PM posted to microsoft.public.access.reports
Gosha
external usenet poster
 
Posts: 13
Default Printing invoices

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
--
Gosha
  #2  
Old August 4th, 2009, 02:36 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Printing invoices

Check this link on how to print the current record on your form
http://www.mvps.org/access/reports/rpt0002.htm

You may need to save the record prior to printing if it is new or updated.

--
Duane Hookom
Microsoft Access MVP


"Gosha" wrote:

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
--
Gosha

  #3  
Old August 4th, 2009, 02:43 PM posted to microsoft.public.access.reports
Gosha
external usenet poster
 
Posts: 13
Default Printing invoices

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?



--
Gosha


"Duane Hookom" wrote:

Check this link on how to print the current record on your form
http://www.mvps.org/access/reports/rpt0002.htm

You may need to save the record prior to printing if it is new or updated.

--
Duane Hookom
Microsoft Access MVP


"Gosha" wrote:

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
--
Gosha

  #4  
Old August 4th, 2009, 02:47 PM posted to microsoft.public.access.reports
Gosha
external usenet poster
 
Posts: 13
Default Printing invoices

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!
--
Gosha


"Gosha" wrote:

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
--
Gosha

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.