I am trying to have certificates printed. But I need them to be printed according to when the class was given. If a class was before 4/1/2019 I want a certain report printed. If it was after 4/1/2019, I want a different report printed. This was the code I tried:
If (cboPassFail = 1) And ((Forms!frmTrainingRosterCloseOutAll!DOT) >= (4 / 1 / 2019)) Then
DoCmd.OpenReport "rptTrainingCertDept2", acViewReport, "", "", acNormal
DoCmd.RunCommand acCmdPrintPreview
ElseIf (cboPassFail = 1) And ((Forms!frmTrainingRosterCloseOutAll!DOT) <= (4 / 1 / 2019)) Then
DoCmd.OpenReport "rptTrainingCertDept", acViewReport, "", "", acNormal
DoCmd.RunCommand acCmdPrintPreview
Else
Beep
MsgBox "Printing a certificate requires a passing grade", vbOKOnly, ""
End If
Both printed rptTrainingCertDept2