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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameters in a Report.



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2004, 12:35 AM
Amy Johnson
external usenet poster
 
Posts: n/a
Default Parameters in a Report.

I want to place a second report in a existing report. The
reports are based on a parameter query. The information
that is prompted for is the same on both reports, a date
range. When I put the second report in the exisiting
report it always prompts me for the dates twice when I
run the report. Is there anyway around this?
  #2  
Old May 20th, 2004, 01:02 AM
fredg
external usenet poster
 
Posts: n/a
Default Parameters in a Report.

On Wed, 19 May 2004 16:35:24 -0700, Amy Johnson wrote:

I want to place a second report in a existing report. The
reports are based on a parameter query. The information
that is prompted for is the same on both reports, a date
range. When I put the second report in the exisiting
report it always prompts me for the dates twice when I
run the report. Is there anyway around this?


Create an unbound form. Add 2 Text Controls.
Name one StartDate and the other EndDate.
Set their Format property to a Date format.

Add a command button.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In each query, in it's Date field's criteria line, write:
Between forms!ParamForm!StartDate AND forms!ParamForm!EndDate

Next, code the Main Report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the main report's Close event:
DoCmd.Close acForm, "ParamForm"

If you also wish to actually show the date range in the main report,
add an unbound control to the report header.
Set it's control source to:
= "For Sales between " & forms!ParamForm!StartDate & " AND " &
forms!ParamForm!EndDate

When ready to run the report, open the report. The form will display
and wait for the entry of the dates. Click the command button and the
report will run without need for any further parameter entries. When
the report closes, it will close the form.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old May 20th, 2004, 01:05 AM
Terry
external usenet poster
 
Posts: n/a
Default Parameters in a Report.

Amy,

I usually put my parameters into an unbound form and have
the query(s) reference the form's controls. You have to
keep the form open for the query(s) to run.

Terry

-----Original Message-----
I want to place a second report in a existing report. The
reports are based on a parameter query. The information
that is prompted for is the same on both reports, a date
range. When I put the second report in the exisiting
report it always prompts me for the dates twice when I
run the report. Is there anyway around this?
.

 




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 05:42 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.