473,468 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Subreport or DLookup?

Ron
Hi All,

Was just wondering which is faster, a subreport or dlookup.

I've got a report with either 5 subreports or lots of dlookups. The
subreports generally have anywhere from 5 to 12 controls on them so if I
don't do the subreport thing, I'm doing TONS of dlookups.

Just wondering what others have found to be a faster way to do things. Is
there even a faster way I'm unaware of yet than these 2 options?

Thanks in advance for any help,
ron
May 30 '06 #1
6 2470
The only way to know for sure is to try both. Both Subforms and DLookups can
be surprisingly speedy or dead-dog slow, depending on factors that are
difficult to determine. (My _guess_ would be that Subforms were faster,
particularly if you are able to limit the contents using an indexed field,
but it's only a guess.)

Larry Linson
Microsoft Access MVP

"Ron" <ro*******************@earthlink.com> wrote in message
news:_g*************@newsread3.news.pas.earthlink. net...
Hi All,

Was just wondering which is faster, a subreport or dlookup.

I've got a report with either 5 subreports or lots of dlookups. The
subreports generally have anywhere from 5 to 12 controls on them so if I
don't do the subreport thing, I'm doing TONS of dlookups.

Just wondering what others have found to be a faster way to do things. Is
there even a faster way I'm unaware of yet than these 2 options?

Thanks in advance for any help,
ron

May 30 '06 #2
More important to your question is the fact that DLookup and subreports are
not substitutes for each other. If you have multiple rows of related data
to display, you're going to have to use a subreport.

Example: A customer can have many orders (order headers). An order header
can have many details (order lines).

If you want to print a customer and then a list of his orders, you must use
a subreport. There is no way with dlookup() to generate the multiple
linesyou would need to represent each of the lower level (order header)
records.

If this is similar to your task, the relative speed of dlookup and
subreports is not relevant.
May 31 '06 #3
Ron
I'm rewriting stuff and I'll import a ton of data into all
the tables and then I'll try it both ways under the clock. Plus, I'm going
to try some subqueries as well to see how that effects speed for this type
of thing.

The reason I asked the question in the first place is that I've written it
with the subreports option and it just seems "slow" looking. Thought I'd
ask the question and if people had lots of experience going one way over
another, I'd find out here and wouldn't have to work so hard. ::grin::
But, I guess I need to experiment--not a bad thing.

Thanks for your response, Larry. I appreciate your time.
ron

"Larry Linson" <bo*****@localhost.not> wrote in message
news:nZ2fg.6188$%C6.3544@trnddc08...
The only way to know for sure is to try both. Both Subforms and DLookups
can be surprisingly speedy or dead-dog slow, depending on factors that are
difficult to determine. (My _guess_ would be that Subforms were faster,
particularly if you are able to limit the contents using an indexed field,
but it's only a guess.)

Larry Linson
Microsoft Access MVP

"Ron" <ro*******************@earthlink.com> wrote in message
news:_g*************@newsread3.news.pas.earthlink. net...
Hi All,

Was just wondering which is faster, a subreport or dlookup.

I've got a report with either 5 subreports or lots of dlookups. The
subreports generally have anywhere from 5 to 12 controls on them so if I
don't do the subreport thing, I'm doing TONS of dlookups.

Just wondering what others have found to be a faster way to do things.
Is there even a faster way I'm unaware of yet than these 2 options?

Thanks in advance for any help,
ron


May 31 '06 #4
Ron
Thanks for your response, Rick. However, if I I was performing a task that
required one or the other, I wouldn't be asking this question. As I said in
the initial post, I have multiple controls coming from different tables
linked by a common field. Maybe I wasn't clear though about how only 1 row
of data from the sub-tables per report is being accessed, but anywhere from
5 to 12 controls (fields) per table is being used per report page. And,
I've got 5 subreports (hitting on 5 separate tables via queries) doing all
this. So, would it be faster to continue using this method, or would it
behoove me to rewrite stuff to do lots of dlookups instead--that's my
dilemma. Or, would even sub-queries be faster?

I'll experiment. But, again, thanks for your response Rick,
ron
"Rick Wannall" <wa*****@notadomain.de> wrote in message
news:MU******************@newssvr11.news.prodigy.c om...
More important to your question is the fact that DLookup and subreports
are
not substitutes for each other. If you have multiple rows of related data
to display, you're going to have to use a subreport.

Example: A customer can have many orders (order headers). An order
header
can have many details (order lines).

If you want to print a customer and then a list of his orders, you must
use
a subreport. There is no way with dlookup() to generate the multiple
linesyou would need to represent each of the lower level (order header)
records.

If this is similar to your task, the relative speed of dlookup and
subreports is not relevant.

May 31 '06 #5
Based on the little I know about the mechanics of the data-gathering and
report-formatting phases, I would bet that the subreport approach would have
to be faster. If you can get the data you want by using links between
tables, and if you properly index those tables (all have primary keys, and
the fields in other tables that contain those values as foreign keys are
indexed as well), then the data can be gathered as intelligently as the JET
engine is capable of getting it. This has to beat repeated calls to the
DLookup function during the data gathering phase.

If you do some detailed testing, I for one would be very interested in your
results.
May 31 '06 #6
Ron

"Rick Wannall" <wa*****@notadomain.de> wrote in message
news:K9*********************@newssvr29.news.prodig y.net...
Based on the little I know about the mechanics of the data-gathering and
report-formatting phases, I would bet that the subreport approach would
have
to be faster. If you can get the data you want by using links between
tables, and if you properly index those tables (all have primary keys, and
the fields in other tables that contain those values as foreign keys are
indexed as well), then the data can be gathered as intelligently as the
JET
engine is capable of getting it. This has to beat repeated calls to the
DLookup function during the data gathering phase.

If you do some detailed testing, I for one would be very interested in
your
results.


Thanks for the response, Rick.

Yeah, that's what I was thinking, but I was hoping Dlookup would be faster,
cause the subreport thing just "looks" slow. Perhaps this will be a point
where I'll have to redirect the user's attention.

I will try a couple different ways to go (subreports/indexing etc, dlookup,
subqueries instead of either of those) and I've got tons of data to test it
with, so should get a pretty good feel for what is faster when. I'll post
my results when I have them.

Thanks again,
ron
May 31 '06 #7

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

Similar topics

1
by: Steve Edwards | last post by:
I am trying to use an existing report as a subreport in another report. I have the subreport added to the main report, but the only thing that shows up where the subreport should be is the name of...
8
by: dixie | last post by:
I have a report with a subreport. The source object for this subreport varies according to the value of a field in a table. I am trying to programmatically set the object source for the subreport...
1
by: Johm | last post by:
I have 2 queries, qryinput and qryoutput.I have to substract the cartons from qryinput from the qry output.I cannot do it with a third query since the queries are incompatible, and i want to do it...
7
by: Ellen Manning | last post by:
I've got an A2K report showing students and their costs. Student info is in the main report and costs are in a subreport for each student. The user inputs the program desired then only those...
1
by: shaqattack1992-newsgroups | last post by:
I know this is kind of a weird question, but is there anyway to give a subreport control of a main report? I posted my situation earlier about having drawings print out after a group. I have a...
5
by: Tom | last post by:
I have a subreport that can contain one or two pictures per page. The subreport is similar to an appendix to the main report. The recordsource contains a field "IncludeInReport" (Yes/No) for each...
0
by: C | last post by:
Hi, I have a main Report which has a SubReport. This SubReport also has a SubReport. I set the data of my main Report and Subreport through code DataSet dsMainReport =...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
0
by: Justin K | last post by:
I have an issue with a Crystal Report that I am using in my C# program. I created the report in Crystal Reports XI(R2). The report's datasource is an SQL stored procedure, and contains a...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.