Set value in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a menu with many buttons on it, each one applying a different filter
to the same report. I want to make the report reflect which filter they
chose to apply, activated by a macro, if possible.

Example: If they choose to filter results by date, I want the subtitle on
the report to say something like "by date."

Thanks for any help you can provide.
 
Add the following to each button's code"
Reports!NameOfReport!NameOfSubtitleTextbox = "By Date"
<Or whatever the button's filter does>
 
Kark said:
I have a menu with many buttons on it, each one applying a different filter
to the same report. I want to make the report reflect which filter they
chose to apply, activated by a macro, if possible.

Example: If they choose to filter results by date, I want the subtitle on
the report to say something like "by date."


I like to have an invisible, unbound text box on the form
for this kind of thing. Then each button's click event can
set the text box to whatever you want to describe as the
filter's description. (I have never used macros, but it
should just be a SetValue action.)

This way, the report's subtitle text box can use an
expression like:

=FORMS!themenuform.thetextbox

to display a description of whatever filter the button used.
 
I tried PC Datasheet's solution and it didn't work. As far as Marshall's, I
have no idea what that means. Sorry, I'm still learning, but thanks for
trying. Anyone else got any ideas?
 
Go to the code for the button that filters by date. After the line of code
that opens the report, add this line of code:
Reports!NameOfReport!NameOfSubtitleTextbox = "By Date"
NOTE:
1. You must put the name of your report where the above says "NameOfReport"
2. You must put the name of the subtitle textbox on your report where the
above says "NameOfSubtitleTextbox"
3. By Date must be enclosed in parantheses as shown
 
Alright, I took another look at this, and I realized I had read it wrong the
first time. There's no better way to say it than "You hit the nail right on
the head!" Awesome job, thanks a lot.
 
Back
Top