B
Bonnie A
Hi everyone! Using A02 on XP. I have a validation macro that checks for
rules and then will preview the report if the macro doesn't stop for a rule
violation. However, I need to preview the report for just the record showing
on my form.
I know how to make a button to print just the one by using this wordage:
DoCmd.OpenReport "rPlanAuditMain", acViewPreview, , "[AuditID]=" &
Me![AuditID]
DoCmd.RunCommand acCmdZoom100
If I just add the above wordage to the button running the macro, I get the
preview whether there are rule violations or not. I'm trying to add the
preview report at the end of the macro rather than have a validate button AND
a preview button as users may preview before testing the rules. (I can also
have the preview button visible or not visible based upon the macro button
being clicked but want to avoid 2 buttons.)
I have the macro working fine except for the Where Condition. I've tried
the expression builder and got:
[Reports]![rPlanAuditMain]![AuditID]=[Forms]![fPlanAuditMain]![AuditID]
But, when I run the macro, I get the dialog box asking AuditID.
Can someone help? I know it's something simple but can't figure it out.
Thanks in advance for any assistance!
rules and then will preview the report if the macro doesn't stop for a rule
violation. However, I need to preview the report for just the record showing
on my form.
I know how to make a button to print just the one by using this wordage:
DoCmd.OpenReport "rPlanAuditMain", acViewPreview, , "[AuditID]=" &
Me![AuditID]
DoCmd.RunCommand acCmdZoom100
If I just add the above wordage to the button running the macro, I get the
preview whether there are rule violations or not. I'm trying to add the
preview report at the end of the macro rather than have a validate button AND
a preview button as users may preview before testing the rules. (I can also
have the preview button visible or not visible based upon the macro button
being clicked but want to avoid 2 buttons.)
I have the macro working fine except for the Where Condition. I've tried
the expression builder and got:
[Reports]![rPlanAuditMain]![AuditID]=[Forms]![fPlanAuditMain]![AuditID]
But, when I run the macro, I get the dialog box asking AuditID.
Can someone help? I know it's something simple but can't figure it out.
Thanks in advance for any assistance!