Report & Previous with Print confirmation

G

Guest

Hi all community.I hope someone can help me..



I have a Report, where I print information about Purchases Orders, the form
where I push the botton has a Subform with Product details,also this has a
filter to print only the Order that my form has opened,,all is working fine
but I want to make the following.

I want that at time to push the botton appear the sheet as "Print Previous"
and a Litle message with YES or NOT option, If I select OK, the print it, if
I select NOT then cancel the operation.

pease see the statements that I have :

--------------------------------------------------------------------------------------------
Private Sub printreport_Click()
On Error GoTo Err_printreport_Click

Dim stDocName As String

stDocName = "Orders"
DoCmd.OpenReport stDocName, acNormal, "InvoicesFilter"

Exit_printreport_Click:
Exit Sub

Err_printreport_Click:
MsgBox Err.Description
Resume Exit_printreport_Click

End Su
--------------------------------------------------------------------------------------------
can someone help me please..


Thanks
ldiaz
 
C

Chaim

It sounds like you want a MsgBox(). Try something along these lines:

Sub cmdPrintPrevious_Click ()
If MsgBox ("Print Previous?", vbOKCancel) = vbOK then
Print Previous Action ' I'm not certain what print previous is
supposed to
' do
Else
MsgBox "Request Cancelled"
Exit Sub
End If

I can't tell what is cancelled if the Cancel button is selected- the entire
print operation or simply the Print Previous option. So the use of 'Exit
Sub' may not be what you really want.

Good Luck!
 

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