Stop Form Printing

Fi64

Registered User.
Local time
Today, 19:35
Joined
Jun 6, 2007
Messages
17
I have a form with several reports developed from it with print options buttons created from macros. They all work except when i decide i don't want to print the report .. once I start the macro by clicking on the button, if i cancel it prints the form!! I only have 50 or so records in the database at present but this resulted in over a hundred pages being sent to the printer. I know that ctrl-break stops the macro but I need to automate this as the potential user has no database experience. Can anyone help?? Please!!!!!
 
open the reports in preview mode

then you can cancel them if you change your mind, or print a page range etc
 
Hi Gemma,

Thanks for the reply .. unfortunately I have to have things run automatically as bringing a print preview screen up would confuse the user .. it really has to be a few buttons being clicked to have it all happen behind the scenes
 
is it a macro? or code?

i don't know about macros, but you must need an exit sub or something similar for the cancel action.
 
Its a very simple macro that opens the report and defines the print options .. but its not in code. The report is developed from a parameter query that has the date field criteria set to 'true' this is the code that access created...

Option Compare Database

Private Sub Preview_Report_Click()
On Error GoTo Err_Preview_Report_Click

Dim stDocName As String

stDocName = "Test Report"
DoCmd.OpenReport stDocName, acPreview

Exit_Preview_Report_Click:
Exit Sub

Err_Preview_Report_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click

End Sub

Private Sub Command96_Click()

End Sub

Private Sub Save_Record_Click()
On Error GoTo Err_Save_Record_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Save_Record_Click:
Exit Sub
 

Users who are viewing this thread

Back
Top Bottom