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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|