A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CRITERIA



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2009, 09:24 PM posted to microsoft.public.access.tablesdbdesign
Christina
external usenet poster
 
Posts: 282
Default CRITERIA

I have a report and a sub report running from two queries for which the
criteria in both is Betweenn one date and another date. When running the
report, I have to input the criteria beginning and ending date twice. Please
for help so that I only input the criteria once.

Thanks
  #2  
Old February 25th, 2009, 01:56 AM posted to microsoft.public.access.tablesdbdesign
Ken Snell \(MVP\)
external usenet poster
 
Posts: 2,506
Default CRITERIA

Use a form to run the report (via a command button). On the form, put two
textboxes, one for each of the date values. Format the textboxes for Short
Date or any other date format you wish. Change the two queries so that they
read the parameters from the form (keep it open while the report runs):

[Forms]![NameOfTheForm]![NameOfTheTextbox]
--

Ken Snell
MS ACCESS MVP
http://www.accessmvp.com/KDSnell/


"Christina" wrote in message
...
I have a report and a sub report running from two queries for which the
criteria in both is Betweenn one date and another date. When running
the
report, I have to input the criteria beginning and ending date twice.
Please
for help so that I only input the criteria once.

Thanks



  #3  
Old February 25th, 2009, 06:22 AM posted to microsoft.public.access.tablesdbdesign
Jack Cannon[_2_]
external usenet poster
 
Posts: 4
Default CRITERIA

Another approach is use a form containing two calendars (BegCalendar and
EndCalendar).

Each calendar loads their respective global variables (BegDate and EndDate)
during the Form_Unload or Form_Close events. I would also suggest that each
global variable be loaded prior to opening the dual calendar form. Those
variables can then be used to establish a default value for each calendar
(such as today's date).

The queries controlling the report cannot directly access these global
variables but the queries can execute a function that returns the global
variables (GetBegDate() and GetEndDate()).

The dual calendar form can be opened as part of the procedure that opens the
report.

Using this approach eliminates the need to hold any form (including the dual
calendar form) open while the report prints. Also the same dual calendar
form can be used throughout the application for similar objectives since the
dual calendar form is not tied to particular procedure within the application.

Jack Cannon


"Ken Snell (MVP)" wrote:

Use a form to run the report (via a command button). On the form, put two
textboxes, one for each of the date values. Format the textboxes for Short
Date or any other date format you wish. Change the two queries so that they
read the parameters from the form (keep it open while the report runs):

[Forms]![NameOfTheForm]![NameOfTheTextbox]
--

Ken Snell
MS ACCESS MVP
http://www.accessmvp.com/KDSnell/


"Christina" wrote in message
...
I have a report and a sub report running from two queries for which the
criteria in both is Betweenn one date and another date. When running
the
report, I have to input the criteria beginning and ending date twice.
Please
for help so that I only input the criteria once.

Thanks




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.