Using forms to select a report from multiple base queries 
Author Message
 Using forms to select a report from multiple base queries

Hi again,

Here's my problem: can anyone help?

In an MS Works database, you can apply one of eight custom queries to your
recordset and then run one of eight custom reports over those records.
I need to pull the same stunt in Access 97.
There are eight queries with names "q1" through "q8", and five different
reports.  The approach I was taking was to put a combo box on a form, with
the numbers 1-8 in one column and the names of the eight queries in the
other.  Five different buttons on that form open each individual report.  To
view a report for each query, you'd select the query in the combo box, then
click the button of the report you wanted.

But... I cannot figure it out.  I had a bit of code that would add the
letter "q" to the number stored in the combo box and try to apply that value
as a filter to the report, but no luck.  Is anyone aware of a better way to
do it?

Eight queries      matching to         five reports
q1    \\                                  //     r1
q2     \\                               //       r2
...       ---------------------         r3
q7    //                                \\      r4
q8   //                                  \\      r5

Thanks for your time
~~simon



Fri, 16 Aug 2002 03:00:00 GMT  
 Using forms to select a report from multiple base queries
The filter should do it .....
Put a break in your code by adding the instruction stop
and check the string you are sending as a filter (when you pass your mouse
over a variable you can see it's content in a popup - or you can check the
var's values in the debug window).
Once you'll know what's wrong you'll be able to give us some more details or
to find the cure yourself.
Probably your filter name building code is incorrect

rgds
Andr


Quote:
> Hi again,

> Here's my problem: can anyone help?

> In an MS Works database, you can apply one of eight custom queries to your
> recordset and then run one of eight custom reports over those records.
> I need to pull the same stunt in Access 97.
> There are eight queries with names "q1" through "q8", and five different
> reports.  The approach I was taking was to put a combo box on a form, with
> the numbers 1-8 in one column and the names of the eight queries in the
> other.  Five different buttons on that form open each individual report.
To
> view a report for each query, you'd select the query in the combo box,
then
> click the button of the report you wanted.

> But... I cannot figure it out.  I had a bit of code that would add the
> letter "q" to the number stored in the combo box and try to apply that
value
> as a filter to the report, but no luck.  Is anyone aware of a better way
to
> do it?

> Eight queries      matching to         five reports
> q1    \\                                  //     r1
> q2     \\                               //       r2
> ...       ---------------------         r3
> q7    //                                \\      r4
> q8   //                                  \\      r5

> Thanks for your time
> ~~simon



Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Selecting a report to preview based on controls in a form

2. Cetting A Report To Select Records Based Upon A Value Selected In A Combo Box

3. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

4. Crystal Reports/SQL 2000 - Reporting from a Stored Procedure with multiple selects (for a sub-report)

5. Passing multiple parameters to Access query using Form List Box

6. using selected controls on a form as parameter value for a query

7. Starting query from a form (criterium being based on a text field in the form)

8. Help with linking forms - query based on master form

9. Query based on multiple selection listbox

10. Problem using datatable.select using multiple columns

11. Report based on two queries

12. report based on a crosstab query

 

 
Powered by phpBB® Forum Software