Fredgarner
Technical User
Does anyone know why this code is making my reports print rather than preview? It is choosing from 3 reports, which are selected by option buttons.
Option Compare Database ' Use database order for string comparisons.
Option Explicit ' Requires variables to be declared before they are used.
Private Sub Detail_Click()
End Sub
Private Sub Command56_Click()
On Error GoTo Err_Command56_Click
Dim lcReportName As String
Select Case Me!Reports
Case 1
DoCmd.OpenReport "Current holdings (by intermediary)"
Case 2
DoCmd.OpenReport "Current holdings (by share class)"
Case 3
DoCmd.OpenReport "Current holdings (by shareholder)"
End Select
DoCmd.OpenReport lcReportName, acPreview
Exit_Command56_Click:
Exit Sub
Err_Command56_Click:
MsgBox Err.Description
Resume Exit_Command56_Click
End Sub
Option Compare Database ' Use database order for string comparisons.
Option Explicit ' Requires variables to be declared before they are used.
Private Sub Detail_Click()
End Sub
Private Sub Command56_Click()
On Error GoTo Err_Command56_Click
Dim lcReportName As String
Select Case Me!Reports
Case 1
DoCmd.OpenReport "Current holdings (by intermediary)"
Case 2
DoCmd.OpenReport "Current holdings (by share class)"
Case 3
DoCmd.OpenReport "Current holdings (by shareholder)"
End Select
DoCmd.OpenReport lcReportName, acPreview
Exit_Command56_Click:
Exit Sub
Err_Command56_Click:
MsgBox Err.Description
Resume Exit_Command56_Click
End Sub