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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

pass parameter to report



 
 
Thread Tools Display Modes
  #1  
Old November 23rd, 2005, 04:13 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?


  #2  
Old November 23rd, 2005, 05:14 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

On Wed, 23 Nov 2005 12:13:59 +0800, " -00Eric Clapton"
wrote:

I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?


Base the Report on a Query using the parameter as a criterion.


John W. Vinson[MVP]
  #3  
Old November 23rd, 2005, 05:53 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.


"John Vinson" wrote in message
news
On Wed, 23 Nov 2005 12:13:59 +0800, " -00Eric Clapton"
wrote:

I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?


Base the Report on a Query using the parameter as a criterion.


John W. Vinson[MVP]


  #4  
Old November 23rd, 2005, 11:55 PM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

Can anyone please help?


" -00Eric Clapton" wrote in message
...
OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.


"John Vinson" wrote in message
news
On Wed, 23 Nov 2005 12:13:59 +0800, " -00Eric Clapton"
wrote:

I want to write a button which will trigger a specific report required a
parameter. How can I pass a parameter to report using the access code?


Base the Report on a Query using the parameter as a criterion.


John W. Vinson[MVP]





  #5  
Old November 24th, 2005, 12:40 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

On Wed, 23 Nov 2005 13:53:22 +0800, " -00Eric Clapton"
wrote:

OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.


What's the context, Eric? Where is the parameter coming from?

One thing you could do, if the parameter is available within VBA but
not (readily) on a Form or other source, is actually construct the
Report's SQL string in code and set its Recordsource property to the
string.

Or, use the WhereCondition parameter of OpenReport:

Dim strSQL As String
strSQL = "[fieldname] = " & TheParameterValue
DoCmd.OpenReport "rptMyReport", WhereCondition := strSQL

John W. Vinson[MVP]
  #6  
Old January 10th, 2006, 07:17 AM posted to microsoft.public.access.forms,microsoft.public.access.formscoding,microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default pass parameter to report

I put a parameter in select query and create a report which recordsource is
this query. Also write in code as the following suggested, but when I run
the following code. It keeps asking me the parameter value in the query even
after I set the theparametervalue = constant. Please help. THanks.


"John Vinson" wrote in message
...
On Wed, 23 Nov 2005 13:53:22 +0800, " -00Eric Clapton"
wrote:

OK. In coding, what is the syntax to pass the parameter to the query and
how to run the report with passed parameter? Thanks.


What's the context, Eric? Where is the parameter coming from?

One thing you could do, if the parameter is available within VBA but
not (readily) on a Form or other source, is actually construct the
Report's SQL string in code and set its Recordsource property to the
string.

Or, use the WhereCondition parameter of OpenReport:

Dim strSQL As String
strSQL = "[fieldname] = " & TheParameterValue
DoCmd.OpenReport "rptMyReport", WhereCondition := strSQL

John W. Vinson[MVP]



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone seen this behaviour? What might it be? tw General Discussion 4 June 30th, 2005 03:23 PM
To Sharkbyte and all: Calculate a total values in group level Ally General Discussion 6 June 13th, 2005 08:16 PM
cross tab report asks for parameter values eddiec General Discussion 1 April 1st, 2005 05:30 AM
Help!! I'm running around in circles! CathyA New Users 19 December 12th, 2004 07:50 PM
Populate report header field from query parameter jh Setting Up & Running Reports 7 November 13th, 2004 06:38 AM


All times are GMT +1. The time now is 12:44 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.