![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have 2 buttons on a form. Both buttons invoke the same report named "BS". In my report header I have a label depicting the report header. If I click button 1, I'd like this report header to display "Profit & Loss Statement" and if I click button 2, I'd like this report header to display "Balance Sheet". Here's my code on one of the buttons to invoke the report: stDocName = "BS" where_condition = "[category]= 'Income' or [category]= 'EXPENSE'" DoCmd.OpenReport stDocName, acPreview, , where_condition I'd appreciate any help. Regards, Prakash. |
#3
| |||
| |||
|
|
If this is Access 2002 or later, pass the desired title in the OpenArgs of OpenReport. You can then use this in the Control Source of a text box on the report: * * * * =[Report].[OpenArgs] -- Allen Browne - Microsoft MVP. *Perth, Western Australia Tips for Access users -http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Prakash" <prakashwadhw... (AT) gmail (DOT) com> wrote in message news:fda1d36d-6275-4845-9381-2c3fd99705f3 (AT) b2g2000yqi (DOT) googlegroups.com... I have 2 buttons on a form. Both buttons invoke the same report named "BS". In my report header I have a label depicting the report header. If I click button 1, I'd like this report header to display "Profit & Loss Statement" and if I click button 2, I'd like this report header to display "Balance Sheet". Here's my code on one of the buttons to invoke the report: * *stDocName = "BS" * *where_condition = "[category]= 'Income' or [category]= 'EXPENSE'" * *DoCmd.OpenReport stDocName, acPreview, , where_condition I'd appreciate any help. Regards, Prakash. |
![]() |
| Thread Tools | |
| Display Modes | |
| |