Tupacmoche
Registered User.
- Local time
- Today, 08:27
- Joined
- Apr 28, 2008
- Messages
- 291
Hi Report Masters,
I have a case statement that selects a report to use based on a value in the table. This works fine but the DoCmd.OpenReport filter is not. The case statement in triggered by the on click event of the print button, I'm trying to filter on the current record on the form by passing the id in the where clause of the DoCmd.OpenReport is my syntax wrong it dose not work.
Select Case [GiftType]
Case "Pledge"
DoCmd.OpenReport "Pledge_Transmittal_Rpt", acViewPreview, , "DonorAdvanceID ='" & DonorAdvanceID
Case "Pledge Payment"
DoCmd.OpenReport "Gift_Transmittal_Rpt", acViewPreview
"DonorAdvanceID ='" & DonorAdvanceID
End Select
I have a case statement that selects a report to use based on a value in the table. This works fine but the DoCmd.OpenReport filter is not. The case statement in triggered by the on click event of the print button, I'm trying to filter on the current record on the form by passing the id in the where clause of the DoCmd.OpenReport is my syntax wrong it dose not work.
Select Case [GiftType]
Case "Pledge"
DoCmd.OpenReport "Pledge_Transmittal_Rpt", acViewPreview, , "DonorAdvanceID ='" & DonorAdvanceID
Case "Pledge Payment"
DoCmd.OpenReport "Gift_Transmittal_Rpt", acViewPreview
"DonorAdvanceID ='" & DonorAdvanceID
End Select