473,387 Members | 1,891 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,387 software developers and data experts.

How do I avoid Multiple Prompts for Date Range in a report with subreports?

Using Access 2002

I am writing a report which draws data from several different tables. I
can't link all the tables in a query, as some can not be related without
truncating the data. I plan to use sub-queries and sub-reports to
filter and display the data in the unrelated tables in my report. The
common information is a user-inputed date range.

I want to avoid having the user prompted for the [Report_Start_Date] and
[Report_End_Date] variables repeatedly. Somehow I need to capture those
dates as entered, so I can refer to them for all subsequent queries and
sub-reports which are part of the complete report.

I have written one query, based on the table which contains most of the
information I need. I put a Prompt in the Date field which reads:
Between [Report_Start_Date] and [Report_End_Date].

This filters that query as desired, but where do I go from here?

How do I capture those two date variables for reference by other
objects?

Once I have done that, how do I then re-use that data to filter other
objects (unbound text boxes, queries, etc.?

Also, I would like the report to have something in the header like:
From [Report_Start_Date] to[Report_End_Date]. When I put an unbound
text box on the report, I can only see the Expression Builder as a tool
for customizing that control. What is the most optimum way to use the
expression builder to cause the control to display the desired "stored"
variables?

Please go easy on me! I'm just learning Visual Basic, and am trying
hard, but I need just a touch of explanation, and TLC if you can!

Thank you!
BlackFireNova - BFNMULTIPLEDATEPROMPTS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
6 6060
Perhaps setup a basic form to enter those dates and reference the form from
your queries and report?

eg. Forms!frmMyForm![StartDate]

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"BlackFireNova" <BF*****************@myrealbox.com> wrote in message
news:3f*********************@news.frii.net...
Using Access 2002

I am writing a report which draws data from several different tables. I
can't link all the tables in a query, as some can not be related without
truncating the data. I plan to use sub-queries and sub-reports to
filter and display the data in the unrelated tables in my report. The
common information is a user-inputed date range.

I want to avoid having the user prompted for the [Report_Start_Date] and
[Report_End_Date] variables repeatedly. Somehow I need to capture those
dates as entered, so I can refer to them for all subsequent queries and
sub-reports which are part of the complete report.

I have written one query, based on the table which contains most of the
information I need. I put a Prompt in the Date field which reads:
Between [Report_Start_Date] and [Report_End_Date].

This filters that query as desired, but where do I go from here?

How do I capture those two date variables for reference by other
objects?

Once I have done that, how do I then re-use that data to filter other
objects (unbound text boxes, queries, etc.?

Also, I would like the report to have something in the header like:
From [Report_Start_Date] to[Report_End_Date]. When I put an unbound
text box on the report, I can only see the Expression Builder as a tool
for customizing that control. What is the most optimum way to use the
expression builder to cause the control to display the desired "stored"
variables?

Please go easy on me! I'm just learning Visual Basic, and am trying
hard, but I need just a touch of explanation, and TLC if you can!

Thank you!
BlackFireNova - BFNMULTIPLEDATEPROMPTS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2
"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message news:<3f******@nexus.comcen.com.au>...
Perhaps setup a basic form to enter those dates and reference the form from
your queries and report?

eg. Forms!frmMyForm![StartDate]

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response

"BlackFireNova" <BF*****************@myrealbox.com> wrote in message
news:3f*********************@news.frii.net...
Using Access 2002

I am writing a report which draws data from several different tables. I
can't link all the tables in a query, as some can not be related without
truncating the data. I plan to use sub-queries and sub-reports to
filter and display the data in the unrelated tables in my report. The
common information is a user-inputed date range.

I want to avoid having the user prompted for the [Report_Start_Date] and
[Report_End_Date] variables repeatedly. Somehow I need to capture those
dates as entered, so I can refer to them for all subsequent queries and
sub-reports which are part of the complete report.

I have written one query, based on the table which contains most of the
information I need. I put a Prompt in the Date field which reads:
Between [Report_Start_Date] and [Report_End_Date].

This filters that query as desired, but where do I go from here?

How do I capture those two date variables for reference by other
objects?

Once I have done that, how do I then re-use that data to filter other
objects (unbound text boxes, queries, etc.?

Also, I would like the report to have something in the header like:
From [Report_Start_Date] to[Report_End_Date]. When I put an unbound
text box on the report, I can only see the Expression Builder as a tool
for customizing that control. What is the most optimum way to use the
expression builder to cause the control to display the desired "stored"
variables?

Please go easy on me! I'm just learning Visual Basic, and am trying
hard, but I need just a touch of explanation, and TLC if you can!

Thank you!
BlackFireNova - BFNMULTIPLEDATEPROMPTS

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


I had a similar problem. I used a custom dialog box which made one of
the sub queries in code. The query had 2 expressions StartDate &
EndDate that could be used as fields in the report's header.
I've only been working with access for a couple of months & I'm a
total amateur so this may not be a good way to do this, but it does
work.
Nov 12 '05 #3
I do this quite often and use a create table or append query to add
the date range into a table. You can then reference this table in all
subsequent queries, which means you'll only get prompted once. You
can also reference these dates in your report.

For example, I would set up a table called tbl_date with the two
fields in start_date and end_date, and create an append query to add
the dates to the table. This means before you run the append query
you will have to run a delete query to delete any dates that were in
there previously.

Hope this helps.
Nov 12 '05 #4
Thanks to all of you for the help with the start / end date problem.
I used a form as suggested and referenced it, and it worked great.

On that form I also decided to include some fill-in fields for the
header of the report. One of the fields I wanted was to simply show
the current month, in TEXT.

I created an unbound text box and put in the following:
Month(Date()) This gave me the NUMERIC month.

I then tried : Format(Month(Date()),"mmmm"), thinking OK, this would
take the numeric month, and turn it into the TEXT Month Name, but for
some reason it returns JANUARY (instead of November, which the Date()
right now would come up with 11.

How can I modify this or what command can I use to take the Date() and
extract the month (11), and then turn it into the TEXT Month
(November)?

BlackFireNova BFNMULTIPLEDATEPROMPTS BFNMONTHNAME

rh******@yahoo.com (Sarah) wrote in message news:<73**************************@posting.google. com>...
I do this quite often and use a create table or append query to add
the date range into a table. You can then reference this table in all
subsequent queries, which means you'll only get prompted once. You
can also reference these dates in your report.

For example, I would set up a table called tbl_date with the two
fields in start_date and end_date, and create an append query to add
the dates to the table. This means before you run the append query
you will have to run a delete query to delete any dates that were in
there previously.

Hope this helps.

Nov 12 '05 #5
I've done the table thing elsewhere in my database and it works well.
I hadn't thought of doing it for the report. I wonder if one method is
faster than the other? My report take a while to load but I'd assumed
that this was due to the amount of calculations that it was doing, but
now I'm not so sure. Anyone Know?
Nov 12 '05 #6
Thanks for the suggestion about making up the table, and the delete
query. It worked great!

Much appreciation to everyone who helped!

BlackFireNova

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #7

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

Similar topics

4
by: deko | last post by:
I can't move a multi-page report to the last record unless I keep the popup form (that defined it's subreports) open. DoCmd.OpenReport "rptStandard", acViewNormal DoCmd.Close acForm,...
6
by: David B | last post by:
I have a report with 2 sub reports on it. The report is an invoice and the sub reports are dropping data onto the invoice. This worked fine if generating 1 invoice at a time. I am trying to create...
1
by: Laura Stout | last post by:
Hello, first time posting, so bear with me. I am working on a kennel database and am attempting to generate a report showing complete information for each litter. The finished product I am going...
2
by: DaveDiego | last post by:
I'm building a report that has a count of cases for employees. I have separate queries that count, OpenCases, NewCases, TotalCases, Etc. I would like to put all those counts into a record for each...
1
by: Norma | last post by:
I have one report that consists of 3 subreports. Each subreport is pulled from a query with date parameters ( Between and ). When I run this report I have to enter the date parameters 3 times....
3
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
3
by: joelpollock | last post by:
I'm having trouble continuously page numbering a large report in MS Access. The report is made up of three separate Access reports which I join together at the end. In the past I have opened the...
6
by: Brett Barry: Go Get Geek! | last post by:
Hello, I have a main report with a Record Source, a DateToday table, that has the current Month and Year. I have about 60 queries, each pulling different data via ODBC, that I am creating...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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...

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.