473,378 Members | 1,066 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Etiquette Question - Calling reports from multiple locations

I'm wondering . . . .

What is the generally accepted method for calling reports from multiple
locations?

Example:

REPORT-A is called by selecting a record in a listbox and clicking a
button. The queries behind the record use the listbox value (selected)
as criteria to limit/build the report data.

Now, suppose I want to call that same report from a different form and
use the value of a text box as the criteria to limit the report data,
rather than the listbox selection.

Currently, I have a second set of queries that are limited using the
second criteria and a second report that calls those queries.

Seems like a very cumbersome way to accomplish this.

Anyone have a better way?

Nov 13 '05 #1
6 1749
one way, and perhaps the most flexible, is to build the report without
any filters. then you can pass the filter you want from anywhere. So
if you call it from FormA, you can build the filter there (same as a
Where clause without the Where keyword), and then pass the filter in
the open event of the report.

This is especially useful when you have something like a multi-select
listbox to limit the contents of your report, since you have to loop
through the .ItemsSelected collection in code anyway. Once you have
that filter, you can just pass it as usual to the report's open method.

Nov 13 '05 #2
That will work if the report is a simple, single source report (one
query or table).

The problem I am running into is that I have this:

REPORT-A is based on QUERY-A
There are 3 sub-reports on the form.
SUBREPORT-A is based on QUERY-B which is a subset of QUERY-A
SUBREPORT-B is based on QUERY-C which is a different subset of QUERY-A
SUBREPORT-C is based on QUERY-D which is yet another subset of QUERY-A

If I call REPORT-A from a macro and use the Where Condition to limit,
the REPORT-A is limited to only the records I need, but all the
subreports arent limited since the Where Condition doesnt apply to
them. I therefore get all records in the three subs no matter which
record I'm limited to in the main report.

I'm thinking maybe I can use some value from REPORT-A to limit the
queries that feed data to the sub-reports but I cant seem to get that
to work.

Was hoping I was missing something simple.

Thanks for the reply. If you have any further thoughts, please pass
them on.

Nov 13 '05 #3
Ooops. I mean there are 3 sub-reports on the REPORT. Not on the form.

Nov 13 '05 #4

Sr********@azorinc.com wrote:
That will work if the report is a simple, single source report (one
query or table).

The problem I am running into is that I have this:

REPORT-A is based on QUERY-A
There are 3 sub-reports on the form.
SUBREPORT-A is based on QUERY-B which is a subset of QUERY-A
SUBREPORT-B is based on QUERY-C which is a different subset of QUERY-A SUBREPORT-C is based on QUERY-D which is yet another subset of QUERY-A
If I call REPORT-A from a macro and use the Where Condition to limit,
the REPORT-A is limited to only the records I need, but all the
subreports arent limited since the Where Condition doesnt apply to
them. I therefore get all records in the three subs no matter which
record I'm limited to in the main report.

I'm thinking maybe I can use some value from REPORT-A to limit the
queries that feed data to the sub-reports but I cant seem to get that
to work.

Was hoping I was missing something simple.

Thanks for the reply. If you have any further thoughts, please pass
them on.


If your main report and subreports cannot be redesigned such that the
linking field(s) between them all enforces your limiting criteria, you
could possibly use the main report's open event to set the filter
property of each subreport, e.g.

Private Sub Report_Open(Cancel As Integer)

Me!MySubreportA.Report.Filter=Me.Filter
Me!MySubreportB.Report.Filter=Me.Filter
' etc.

End Sub

HTH,
Bruce

Nov 13 '05 #5
"NO**********@azorinc.com" <rc****@azorinc.com> wrote in
news:11*********************@g14g2000cwa.googlegro ups.com:
What is the generally accepted method for calling reports from
multiple locations?

Example:

REPORT-A is called by selecting a record in a listbox and clicking
a button. The queries behind the record use the listbox value
(selected) as criteria to limit/build the report data.

Now, suppose I want to call that same report from a different form
and use the value of a text box as the criteria to limit the
report data, rather than the listbox selection.

Currently, I have a second set of queries that are limited using
the second criteria and a second report that calls those queries.

Seems like a very cumbersome way to accomplish this.

Anyone have a better way?


In this kind of situation, I often use a class module to store the
values and retrieve them in the OnOpen event of the report and
assign the report's recordsource there.

That way, you can use any form you want to collect the criteria.

I do, however, try to utilize as few criteria collection dialogs as
possible, which means occasionally having them dynamically show/hide
controls. But I would still usually use a class module as a data
storage structure so the report has to interact only with an
instance of that class module.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Thanks for all the input. This is still driving me nutts though.

Here is some more info.

Basically, I have a query that returns 5 records from my database. The
5 records would be similar to this.

Serial# Part# Order#
10001 B35 7
10002 B20 7
10003 B20 7
10004 B35 7
10005 B20 7

The report is a label for the shipping container and it will need the
following information.

1. The Order Information (Order Number, Shipping Info, etc). The main
source of data for the report is the Customer and Order Information,
which is pulled from a different database than the data above. (Hands
are tied on the table layout. Its from a 3rd party database)

2. Subform #1 has a table with the 5 records above listed. A shipment
detail, printed in a small table.

3. Subform #2 has the beginning and ending serial numbers, which I get
by using a Min/Max query on the first query. These are printed in big
block letters.

4. Subform #3 has a shipment summary table similar to the following.

Part# Qty
B20 3
B35 2

So, the form itself filters off the order number specified. In this
case, it will only show the customer and order info for order 7. The
first query has to limit off of the order # as well and the 2nd and 3rd
queries have to query the results of the first query.

If I set the criteria for the first query anywhere but in the form
calling it, the 2nd and 3rd queries wont work!

I HAVE to be missing something simple. This CANNOT be this hard! I'm
thinking that my thinking has thinking too much and I've grown a brain
bubble. I'm going to walk away for a few days and clear out some
cobwebs.

Any additional thoughts would be greatly appreciated.

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Toronto Web Designer | last post by:
Heya, I'm curious to know if there are any programs that convert HTML tables to a CSS layout. I already have a good handle on CSS but I'm always on the lookout for other ways of doing things. ...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
4
by: Oak Hall | last post by:
foreach($_POST as $element=>$val) { echo $element.'--'.$val.'<BR>'; } Where a select multiple html field had several selected values only shows one?? How do I get the others. php 5.1b ...
5
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
by: Richard Mathis | last post by:
My problem is rather complicated (for me), so I'm going to post my problem here as well as what I've done so far to solve my problem. Any assistance would be appreciated. I originally posted this...
0
by: Jason | last post by:
I have a customer who needs multiple people from multiple locations to view ~12 reports. Naturally, I thought a web page hosting these reports would be best however I'm not sure if I should make...
5
by: Stinky Pete | last post by:
Hi (again) ;-) I'm still very much at the bottom of a steep learning curve with VB, so any and all help is always appreciated. I've found some code to generate the user names who have logged...
22
by: g diddy | last post by:
Hi I'm relatively new to VBA and could really do with some help please!! This is going to sound really long winded i'm sorry but I hope it will paint a picture of what i'm trying to do. Basically...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.