Which line triggers the error? Provide full error message.
The Dim statement should be outside the If Then - just below the Sub declaration.
Should user have opportunity to print all 3 or only 1?
Consider these revisions of your code:
Code:
Private Sub Form_Load()
If Me.cdmarker = "cd" Then
If MsgBox("Do you want to print ClosingDisclosure Pages 2a?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReport", acViewNormal
End If
If MsgBox("Do you want to print ClosingDisclosure Pages 2a Seller Only?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReportSellerOnly", acViewNormal
End If
If MsgBox("Do you want to print ClosingDisclosure Pages 2a Buyer Only?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReportBuyerOnly", acViewNormal
End If
End If
End Sub
Code:
Private Sub Form_Load()
If Forms!CloseForm.cdmarker = "cd" Then
If MsgBox("Do you want to print ClosingDisclosure Pages 2a?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReport", acViewNormal
ElseIf MsgBox("Do you want to print ClosingDisclosure Pages 2a Seller Only?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReportSellerOnly", acViewNormal
ElseIf MsgBox("Do you want to print ClosingDisclosure Pages 2a Buyer Only?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.OpenReport "Rcdpage2aReportBuyerOnly", acViewNormal
End If
End Sub
I have never used Application.Echo.