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  

Opening a paramater form when open a report



 
 
Thread Tools Display Modes
  #1  
Old August 15th, 2007, 07:56 PM posted to microsoft.public.access.reports
Bob
external usenet poster
 
Posts: 1,351
Default Opening a paramater form when open a report

I have a repor that takes date parameters from a seperate form.. As it is now
I have to open the form put in the paramaters and then run the report which
is based on a query...

I would like to have the form pop up when I open the report and then close
once once the report has run..

Help Please

And thanks in advance

bob

  #2  
Old August 15th, 2007, 08:45 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Opening a paramater form when open a report

On Wed, 15 Aug 2007 11:56:00 -0700, Bob wrote:

I have a repor that takes date parameters from a seperate form.. As it is now
I have to open the form put in the paramaters and then run the report which
is based on a query...

I would like to have the form pop up when I open the report and then close
once once the report has run..

Help Please

And thanks in advance

bob


You don't mention what parameters you need to enter, so the below code
includes Company and Date parameters.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Also add 2 unbound text controls.
Set their format to a valid date format.
Name them "StartDate" and "EndDate"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CompanyID] field criteria line write:
forms!ParamForm!FindCompany

As criteria in the query date field write:
Between forms!Paramform!StartDate and forms!ParamForm!EndDate

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

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

When ready to run the report, open the report.
The form will open and wait for the selection of the Company and the
entry of the starting and ending dates wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




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 08:09 AM.


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