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  

Pass parameter value to sub report query



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2007, 10:40 PM posted to microsoft.public.access.reports
Natalie
external usenet poster
 
Posts: 212
Default Pass parameter value to sub report query

Hi All,

I would like to pass the parameter value of the first prompt (main report)
to the second prompt (sub report). For example.

Query 1.Main Rpt. Selects all loan records where customer like “*”&[
Name]&”*”

Query 2 Sub Rpt. Select all other records where customer like “*”&[]&”*”

When I run the report I’d like to pass the value of the 1st prompt to the
second prompt so I would only prompt once.

Can that be done…how do I go about setting that up?

Thanks for all you help.

Nats

  #2  
Old August 6th, 2007, 11:28 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Pass parameter value to sub report query

One way is to enter the parameter in an unbound textbox on a form and call
the form in the criteria.
Like "*" & [Forms]![YourFormName]![YourTextBox] & "*"
--
KARL DEWEY
Build a little - Test a little


"Natalie" wrote:

Hi All,

I would like to pass the parameter value of the first prompt (main report)
to the second prompt (sub report). For example.

Query 1.Main Rpt. Selects all loan records where customer like “*”&[
Name]&”*”

Query 2 Sub Rpt. Select all other records where customer like “*”&[]&”*”

When I run the report I’d like to pass the value of the 1st prompt to the
second prompt so I would only prompt once.

Can that be done…how do I go about setting that up?

Thanks for all you help.

Nats

  #3  
Old August 6th, 2007, 11:59 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Pass parameter value to sub report query

Natalie wrote:
I would like to pass the parameter value of the first prompt (main report)
to the second prompt (sub report). For example.

Query 1.Main Rpt. Selects all loan records where customer like *&[
Name]&*

Query 2 Sub Rpt. Select all other records where customer like *&[]&*

When I run the report Id like to pass the value of the 1st prompt to the
second prompt so I would only prompt once.

Can that be donehow do I go about setting that up?



That's one of the problems when you use those quick and
dirty parameter prompts.

Far better is to use a form to open the report from a form
where you can use text boxes for the parameter values. This
way, the query parameters would be like:
Forms!yourform.thetextbox


--
Marsh
MVP [MS Access]
  #4  
Old August 7th, 2007, 03:04 PM posted to microsoft.public.access.reports
Natalie
external usenet poster
 
Posts: 212
Default Pass parameter value to sub report query

Yes parameter prompts are quick and easy to use. I'll approach it the way
you suggest.

Thanks for you quick response.


"Marshall Barton" wrote:

Natalie wrote:
I would like to pass the parameter value of the first prompt (main report)
to the second prompt (sub report). For example.

Query 1.Main Rpt. Selects all loan records where customer like “*”&[
Name]&”*”

Query 2 Sub Rpt. Select all other records where customer like “*”&[]&”*”

When I run the report I’d like to pass the value of the 1st prompt to the
second prompt so I would only prompt once.

Can that be done…how do I go about setting that up?



That's one of the problems when you use those quick and
dirty parameter prompts.

Far better is to use a form to open the report from a form
where you can use text boxes for the parameter values. This
way, the query parameters would be like:
Forms!yourform.thetextbox


--
Marsh
MVP [MS Access]

 




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 11:57 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.