Stop automatic printing of reports in Access 2007

VelvetVoice

Registered User.
Local time
Today, 07:31
Joined
Mar 2, 2012
Messages
12
This database was designed about 15 years ago, and we just converted it to Access 2007. There are embedded Print Report directions in here, but I don't know how to get to them. I already tried following backwards on the autoprint thread, but it didn't work. :confused: Can anyone help me?
 
What steps do you take to print the reports now. If we know how you execute, then we might be able to help you find the VBA or Macros that run the reports.
 
When I press the Run button, it automatically prints the report. I'd like to just see the results and not print. I have a copy of the database, so I can try different things without breaking the original.
 
Last edited:
Is the Run Button a command button on a form? If yes, then open your form in design view. Right click on the button. Select Properties. Select Events. In the on click event, you should have information. Scroll to the right in that box and you should see an ellipsis (...). Click on it and it will either give you the VBA or a Macro. Copy what is there and post it here so that we can see what is driving this and offer suggestions.

Alan
 
Option Compare Database 'Use database order for string comparisons
Option Explicit
Private Sub cmdexit_Click()
On Error Resume Next
DoCmd.Close A_FORM, "Report: Par List"
If Err <> 0 Then
Call errorhandler(4, "Report: Par List.cmdexit_click", "Report: Par List")
End If
End Sub
Private Sub cmdrunrpt_Click()
Dim reportname As String
reportname = "Par List: List"
On Error Resume Next
reportoption = grprptopt
DoCmd.OpenReport reportname
If Err = 0 Then
enablereportbuttons Me, "run"
cmdexit.SetFocus
Else
Call errorhandler(7, "Par List: List.cmdrunrpt_click", reportname)
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
'set up the screen
DoCmd.Maximize
setupscreen Me
If errornumber = 0 Then
setreportbuttons Me, 3.6
If errornumber = 0 Then
enablereportbuttons Me, "load" ' activate command buttons
If errornumber = 0 Then
cmdexit.SetFocus
End If ' enablereportbuttons ok
End If ' setreportbuttons ok
End If ' setupscreen ok
'set up title and status bar messages
Txttitle.Caption = "Report: Par List"
cmdexit.StatusBarText = "Leave and Don't Run the Report."
'blank out the undo button
cmdundo.Visible = False
End Sub
Private Sub optdesc_KeyPress(KeyAscii As Integer)
cmdrunrpt.Enabled = True
End Sub
Private Sub optdesc_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdrunrpt.Enabled = True
End Sub
Private Sub optid_KeyPress(KeyAscii As Integer)
cmdrunrpt.Enabled = True
End Sub
Private Sub optid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
cmdrunrpt.Enabled = True
End Sub
 
In this line of code, because there is no optional information provided, it defaults to sending the report directly to the printer.
Code:
DoCmd.OpenReport reportname

If you wish to review the report first, then you need to change this line to read
Code:
DoCmd.OpenReport reportname, acViewPreview

For reference purposes, here is an explanation that you may want to review.
http://www.blueclaw-db.com/docmd_openreport.htm

Alan
 
Great! That worked! Thanks a million. I'm going to keep this link in my Favorites box so I have a reference. This stuff will all come back to me soon, just getting a kick or two.
 

Users who are viewing this thread

Back
Top Bottom