473,804 Members | 3,018 Online
Bytes | Software Development & Data Engineering Community
+ 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 2494
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************ *******@earthli nk.com> wrote in message
news:_g******** *****@newsread3 .news.pas.earth link.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*****@localh ost.not> wrote in message
news:nZ2fg.6188 $%C6.3544@trndd c08...
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************ *******@earthli nk.com> wrote in message
news:_g******** *****@newsread3 .news.pas.earth link.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*****@notado main.de> wrote in message
news:MU******** **********@news svr11.news.prod igy.com...
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*****@notado main.de> wrote in message
news:K9******** *************@n ewssvr29.news.p rodigy.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
4135
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 the subreport. In reading the Access help files, it sounds like there should be LinkChildFields and LinkMasterFields proprties in the propert sheet for the subreport. However, neither of these properties are there for the subreport.. I used...
8
13286
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 as part of the detail format section of the report. I have been playing around with things like: Me.SubReport.SourceObject = Report.sub5O5L but nothing seems to work. Can I achieve what I want to do and if so, can anyone give me the...
1
1260
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 with subreport. If i place a control in the page header section like: =rptInput! i receive the figure only for the first product and not for the all products.If i succeed to place controls in the detail section for each product for the both...
7
3574
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 students in that program are printed. I want the subreports headings to print only for the first student on the page. Is there a way to suppress printing of the headings on subsequent students on that page? I tried the following in both the...
1
3778
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 report grouped by part group that lists the part numbers needed from that group. I have force new page after each group. This gives me a list of parts on each page. I want to print the needed drawings after the groups/list of parts. There are...
5
2204
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 picture record. What code do I use and where does it go to prevent printing the subreport if there are no picture records marked "Yes" in the "IncludeInReport" field? Thanks, Tom
0
4277
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 = daLayer.GetMainReportData();
11
7462
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
1485
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 subreport in the report header. The subreport's datasource is another stored procedure. Both reports require the same 2 parameters. I linked the main report's parameters to the subreport's parameters.
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10303
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10070
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5508
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
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 we have to send another system

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.