1 button many reports

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

Guest

Hi,
I have a form with 10 report buttons once one of these buttons are clicked
the relevant criteria and the print button appear on the form, once the
criteria is entered and the print button is clicked the relevant report is
opened.

What I have at the moment is 10 print buttons all sitting on top of each
other and the relevant one appears dependent on which of the original 10
report buttons is clicked.

What i would like to know is how to reset the OnClick() code for the print
report button (instead of having ten print buttons) dependening on which of
the report buttons is clicked

Hope I've made sense
 
Wuelf,

An easy "trick" to do it is to use a hidden, unbound textbox on the
form; once a report button is clicked, it puts the name of the report in
the textbox. Then the single print button just reads the name of the
report to openn from the textbox.

Another approach I would prefer, is to use a listbox with the report
names instead of the ten report buttons; the click (or double-click)
event of it can fire a pice of code that makes the appropriate criteria
controls appear (a Select Case would be appropriate here), wjile it also
holds the name of the selected report without the need for a hidden textbox.

HTH,
Nikos
 
Your second approach looks really good. A variation on that would be an
option group with an option button for each report and a command button with
the select case to select the report.
 
I personally use the listbox method but what i do is link that listbox to a
reports table. that way, if in the future, a new report is needed or an old
report becomes obsolete, i just have to go into my report table and add or
delete a report name and call it done.
 
And one more "tweak" ... I add a "Hide" (Yes/No) column or an "EndDate"
(Date/Time) column to my table of reports, and only list the "active" ones
in my listbox.

Jeff Boyce
<Access MVP>
 
hey thats a good one Jeff! I like that idea. I've also used a catagories
column to use 1 table to populate different report lists i.e. i had 2 lists
of reports, 1 universal reports list and 1 vendor specific report list both
read from the same table but filtered by catagory and in the table labelled
them as universal or specific.
 
Back
Top