473,654 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a2k - returning the desired records in a subreport - need general help with my approach..

OK, I've been taking the detour from hell trying to sort this and after
taking a walk I think I need a rethink.

I have a report for a single employee that includes a subreport which lists
courses taken by that person.

I ask the user for Start and End dates to allow them to see only courses
that fall into that date range. I'm then trying to open the report to show
the current employee with a list of courses that fall within the date range.

I came up with some SQL that works but I can't assign it to the recordsource
of the subreport as I intended.

The only idea I have is to open the main report and filter for the employee
I want.
Then I think I need to create a stored query that filters the subreport
records and make this the subform recordsource. But I'm not sure how to
create this to include criteria for start and end dates.

What is the best approach here? Am I on the right lines here? If so any
tips about creating a suitable stored query?
Thanks for anyone's suggestions
Martin

Nov 12 '05 #1
2 1806
If you can use a form for the user to enter the limiting dates, you can
refer to the text boxes on the in the subreport's query.

For example, the Criteria Row under the CourseDate field might be:
Between [Forms]![MyForm]![StartDate] And [Forms]![MyForm]![EndDate]

The other alternative you suggested would also work, i.e. to write the SQL
property of the QueryDef that the subreport is based on before opening the
report, e.g.:
dbEngine(0)(0). QueryDefs("MySu breportQuery"). SQL = "SELECT ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Deano" <de*********@ho tmail.com> wrote in message
news:PW******** **********@ward s.force9.net...
OK, I've been taking the detour from hell trying to sort this and after
taking a walk I think I need a rethink.

I have a report for a single employee that includes a subreport which lists courses taken by that person.

I ask the user for Start and End dates to allow them to see only courses
that fall into that date range. I'm then trying to open the report to show the current employee with a list of courses that fall within the date range.
I came up with some SQL that works but I can't assign it to the recordsource of the subreport as I intended.

The only idea I have is to open the main report and filter for the employee I want.
Then I think I need to create a stored query that filters the subreport
records and make this the subform recordsource. But I'm not sure how to
create this to include criteria for start and end dates.

What is the best approach here? Am I on the right lines here? If so any
tips about creating a suitable stored query?
Thanks for anyone's suggestions
Martin

Nov 12 '05 #2
Allen Browne wrote:
If you can use a form for the user to enter the limiting dates, you
can refer to the text boxes on the in the subreport's query.

For example, the Criteria Row under the CourseDate field might be:
Between [Forms]![MyForm]![StartDate] And [Forms]![MyForm]![EndDate]

The other alternative you suggested would also work, i.e. to write
the SQL property of the QueryDef that the subreport is based on
before opening the report, e.g.:
dbEngine(0)(0). QueryDefs("MySu breportQuery"). SQL = "SELECT ...


Allen, you're a godsend. Thanks a million. I used the former method as i
should have done instead of coming up with increasingly complex strategies.
Nov 12 '05 #3

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

Similar topics

3
2470
by: Ryan.Chowdhury | last post by:
This is a general question regarding the use of view and stored procedures. I'm fairly new to databases and SQL. I've created a SQL database using an Access Data Project ("ADP") and I'm satified with the table structure. I've moved on to building some front ends for our users. I'm running into situations where I want subreports to be built from queries that are dependent on the values in other controls. I've played with stored...
2
11746
by: bobh | last post by:
Hi All, I have a report which has several sub-reports on it, Each sub-report has its own record source and child/parent link. Sometimes a sub-report may not have data for an entered policy nbr and on the report thier is just an empty space where that sub-report would be when that happens. How do I get the sub-report to still display on the report when it has no data????
0
1125
by: Helen | last post by:
vb .net 2002 crystal reports 9 Hello: I have a subreport in the report footer of my main report. When the subreport has no records to show, I have a message in the subreport Group Footer stating same. It is followed by a blank page when the application is run, and I want to remove the blank page.
0
1113
by: Helen | last post by:
vb .net 2002 crystal reports 9 Hello: I have a subreport in the report footer of my main report. When the subreport has no records to show, I have a message in the subreport Group Footer stating same. It is followed by a blank page when the application is run, and I want to remove the blank page.
2
2681
by: Thelma Lubkin | last post by:
My ColorSet building form/subform now works beautifully, thanks to the help that I've gotten from people in this group. The working form displays the parent ColorSet record with the child records displayed in the subform below it. ParentTable fields: ColorsetName Classsize ChildTable fields: ColorsetName ColorSequenceNumber RedVal GreenVal BlueVal I've now been asked to allow the user to generate a new ColorSet from
10
1850
by: andrew browning | last post by:
i have overlaoded all of my arithmetic operators but all are functioning as multiplication. below is a sample of the addition operator: Rational operator + (const Rational& r1, const Rational& r2){ //Postcondition: sum of r1 and r2 are returned int numerator; int denominator;
15
13502
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data between application tiers. In fact, there are whole books written on the subject.
11
7448
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"
3
10678
by: Simon van Beek | last post by:
Dear reader, How to change the RecordSource for a subReport. For forms the syntaxes is:
0
8294
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
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
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
8494
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
8596
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...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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...
1
2719
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
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.