T
Tammy
Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click
' This procedure used in Preview_Click and Print_Click Sub procedures.
' Preview or print report selected in the ReportToPrint option group.
' Then close the Print Sales Reports Dialog form.
Dim strWhereOpType As String
strWhereOpType = "Operation Type Description = Forms![Product
Dialog]!SelectOpType"
Select Case Me!ReportToPrint
Case 1
DoCmd.OpenReport "Manufacturer List", PrintMode
Case 2
DoCmd.OpenReport "DateContacted", PrintMode
Case 3
If IsNull(Forms![Product Dialog]!SelectOpType) Then
DoCmd.OpenForm "PopUp Choose"
Else
DoCmd.OpenReport "Manufacturer by Category", PrintMode, ,
strWhereOpType
End If
End Select
DoCmd.CLOSE acForm, "Product Dialog"
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
Resume Exit_Preview_Click
End Sub
Private Sub Cancel_Click()
' This code created by Command Button Wizard.
On Error GoTo Err_Cancel_Click
' Close form.
DoCmd.CLOSE
Exit_Cancel_Click:
Exit Sub
Err_Cancel_Click:
MsgBox Err.Description
Resume Exit_Cancel_Click
End Sub
Private Sub Preview_Click()
' Preview selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acPreview
End Sub
Private Sub Print_Click()
' Print selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acNormal
End Sub
Private Sub ReportToPrint_AfterUpdate()
' Enable SelectCategory combo box if user selected Manufacturer by Category
' report.
Const conManufacturerByCategory = 3
If Me!ReportToPrint.Value = conManufacturerByCategory Then
Me!SelectOpType.Enabled = True
Else
Me!SelectOpType.Enabled = False
End If
End Sub
****************************************************
I have check and checked again and all the information is correct, yet when
I go to the select Op type, it will neither print nor preview. All other
options work. Why is it not recognizing the selected category?
On Error GoTo Err_Preview_Click
' This procedure used in Preview_Click and Print_Click Sub procedures.
' Preview or print report selected in the ReportToPrint option group.
' Then close the Print Sales Reports Dialog form.
Dim strWhereOpType As String
strWhereOpType = "Operation Type Description = Forms![Product
Dialog]!SelectOpType"
Select Case Me!ReportToPrint
Case 1
DoCmd.OpenReport "Manufacturer List", PrintMode
Case 2
DoCmd.OpenReport "DateContacted", PrintMode
Case 3
If IsNull(Forms![Product Dialog]!SelectOpType) Then
DoCmd.OpenForm "PopUp Choose"
Else
DoCmd.OpenReport "Manufacturer by Category", PrintMode, ,
strWhereOpType
End If
End Select
DoCmd.CLOSE acForm, "Product Dialog"
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
Resume Exit_Preview_Click
End Sub
Private Sub Cancel_Click()
' This code created by Command Button Wizard.
On Error GoTo Err_Cancel_Click
' Close form.
DoCmd.CLOSE
Exit_Cancel_Click:
Exit Sub
Err_Cancel_Click:
MsgBox Err.Description
Resume Exit_Cancel_Click
End Sub
Private Sub Preview_Click()
' Preview selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acPreview
End Sub
Private Sub Print_Click()
' Print selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acNormal
End Sub
Private Sub ReportToPrint_AfterUpdate()
' Enable SelectCategory combo box if user selected Manufacturer by Category
' report.
Const conManufacturerByCategory = 3
If Me!ReportToPrint.Value = conManufacturerByCategory Then
Me!SelectOpType.Enabled = True
Else
Me!SelectOpType.Enabled = False
End If
End Sub
****************************************************
I have check and checked again and all the information is correct, yet when
I go to the select Op type, it will neither print nor preview. All other
options work. Why is it not recognizing the selected category?