Sychronizing Report and Parameter Form

T

TotallyConfused

How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.
 
F

fredg

How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.

A Parameter Form is a form into which you enter a query's parameters.
The query is used as the report's record source.
It need not be bound to any particular record.

Here is an example that uses a combo box to find a particular company,
as well as text boxes to enter a starting and ending date.

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 (the Query) [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.
 
T

TotallyConfused

Thank you for responding. This worked. However, in my combo box I get all
on my cmbo box list. Can the combo box just be set to pull only the
individuals listed in the reports. For instance there maybe times when the
report will have two instances of the same report but for different
individuals. How do I code the combo box to only list those two individuals.
Thank you for any help you can provide.

fredg said:
How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.

A Parameter Form is a form into which you enter a query's parameters.
The query is used as the report's record source.
It need not be bound to any particular record.

Here is an example that uses a combo box to find a particular company,
as well as text boxes to enter a starting and ending date.

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 (the Query) [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.
 
F

fredg

Thank you for responding. This worked. However, in my combo box I get all
on my cmbo box list. Can the combo box just be set to pull only the
individuals listed in the reports. For instance there maybe times when the
report will have two instances of the same report but for different
individuals. How do I code the combo box to only list those two individuals.
Thank you for any help you can provide.

fredg said:
How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.

A Parameter Form is a form into which you enter a query's parameters.
The query is used as the report's record source.
It need not be bound to any particular record.

Here is an example that uses a combo box to find a particular company,
as well as text boxes to enter a starting and ending date.

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 (the Query) [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.

How would a combo box "know" which customer is in a report before the
report is run?
It's like saying my telephone white pages should only show the phone
numbers of someone I have called before I have called them.

Re-think your question. You certainly haven't given me enough
information to help you. Remember, a combo box gets it's data from a
table or query, not from a report.
 
T

TotallyConfused

Thank you for explaining. Which is why I am asking for help. Let me explain:
I have a main form with doc info. A subform in within my main form. This
subform lists pts assoc w/doc. On my main form, I have cmd buttons
indicating which report to print depending on doc and pts. I can call the
reports individually or as a batch. All this works fine. However, one
specific report needs to have 4 sets of dates entered before it can
print/email. Reason for parameter form. What I have been trying to do is:
when I call report, for the parameter form to pop up with only the pts
generated from the query/report. If it is one pt, then one form for one pt.
If more than one pt, then form to have the capability to open another
instance of the form for entering dates with the other pt. and so forth.

I have researched and found the following: Allen Browne's paper, Managing
Multiple Instances of a Form, F. Scott Barker's, Managing Multiple Instances
of the same Form and Access Cookbook, Open Multiple Instances of a Form. I
have tried these examples and I can create the multiple instances and so
forth but I can't get get the report and form synchronized and multiple
instances to popup with another pt if needed.

Am I spinning my wheels for nothing? Can this be done. I am reading to
give up but I know how important this is to this project. Can you help me?

Can this be done?

fredg said:
Thank you for responding. This worked. However, in my combo box I get all
on my cmbo box list. Can the combo box just be set to pull only the
individuals listed in the reports. For instance there maybe times when the
report will have two instances of the same report but for different
individuals. How do I code the combo box to only list those two individuals.
Thank you for any help you can provide.

fredg said:
On Mon, 14 Jan 2008 07:24:03 -0800, TotallyConfused wrote:

How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.

A Parameter Form is a form into which you enter a query's parameters.
The query is used as the report's record source.
It need not be bound to any particular record.

Here is an example that uses a combo box to find a particular company,
as well as text boxes to enter a starting and ending date.

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 (the Query) [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.

How would a combo box "know" which customer is in a report before the
report is run?
It's like saying my telephone white pages should only show the phone
numbers of someone I have called before I have called them.

Re-think your question. You certainly haven't given me enough
information to help you. Remember, a combo box gets it's data from a
table or query, not from a report.
 
T

TotallyConfused

I figured it out after I had sent this reply. Thank you.

TotallyConfused said:
Thank you for explaining. Which is why I am asking for help. Let me explain:
I have a main form with doc info. A subform in within my main form. This
subform lists pts assoc w/doc. On my main form, I have cmd buttons
indicating which report to print depending on doc and pts. I can call the
reports individually or as a batch. All this works fine. However, one
specific report needs to have 4 sets of dates entered before it can
print/email. Reason for parameter form. What I have been trying to do is:
when I call report, for the parameter form to pop up with only the pts
generated from the query/report. If it is one pt, then one form for one pt.
If more than one pt, then form to have the capability to open another
instance of the form for entering dates with the other pt. and so forth.

I have researched and found the following: Allen Browne's paper, Managing
Multiple Instances of a Form, F. Scott Barker's, Managing Multiple Instances
of the same Form and Access Cookbook, Open Multiple Instances of a Form. I
have tried these examples and I can create the multiple instances and so
forth but I can't get get the report and form synchronized and multiple
instances to popup with another pt if needed.

Am I spinning my wheels for nothing? Can this be done. I am reading to
give up but I know how important this is to this project. Can you help me?

Can this be done?

fredg said:
Thank you for responding. This worked. However, in my combo box I get all
on my cmbo box list. Can the combo box just be set to pull only the
individuals listed in the reports. For instance there maybe times when the
report will have two instances of the same report but for different
individuals. How do I code the combo box to only list those two individuals.
Thank you for any help you can provide.

:

On Mon, 14 Jan 2008 07:24:03 -0800, TotallyConfused wrote:

How can I get a Report to Open a Paramenter form with the same record
referenced? I just can't seem to get it. I have tried everything! Can
someone please help me with this. Thank you.

A Parameter Form is a form into which you enter a query's parameters.
The query is used as the report's record source.
It need not be bound to any particular record.

Here is an example that uses a combo box to find a particular company,
as well as text boxes to enter a starting and ending date.

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 (the Query) [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.

How would a combo box "know" which customer is in a report before the
report is run?
It's like saying my telephone white pages should only show the phone
numbers of someone I have called before I have called them.

Re-think your question. You certainly haven't given me enough
information to help you. Remember, a combo box gets it's data from a
table or query, not from a report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top