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  

Set report criteria in code?



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 07:14 PM posted to microsoft.public.access.reports
Fredrated
external usenet poster
 
Posts: 77
Default Set report criteria in code?

Is it possible to set a reports criteria in code?

I am trying to use Stephen Lebans report-to-pdf tool, which uses the report
as a parameter. I need to specify a criteria for the report, like I do when
I open the report for printing:
DoCmd.OpenReport strReportName, acViewNormal, , strReportParam

I don't see how to set report criteria in the report-to-pdf tool, but if I
can set the criteria before I use the tool, that should work.

Thanks in advance for any help.

Fred

  #2  
Old April 16th, 2010, 09:00 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Set report criteria in code?

I haven't used Stephens solution but you can always use a little DAO code to
dynamically change the SQL property of a saved query that feeds your report.

--
Duane Hookom
Microsoft Access MVP


"Fredrated" wrote:

Is it possible to set a reports criteria in code?

I am trying to use Stephen Lebans report-to-pdf tool, which uses the report
as a parameter. I need to specify a criteria for the report, like I do when
I open the report for printing:
DoCmd.OpenReport strReportName, acViewNormal, , strReportParam

I don't see how to set report criteria in the report-to-pdf tool, but if I
can set the criteria before I use the tool, that should work.

Thanks in advance for any help.

Fred

  #3  
Old April 16th, 2010, 09:56 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Set report criteria in code?

Fredrated wrote:

Is it possible to set a reports criteria in code?

I am trying to use Stephen Lebans report-to-pdf tool, which uses the report
as a parameter. I need to specify a criteria for the report, like I do when
I open the report for printing:
DoCmd.OpenReport strReportName, acViewNormal, , strReportParam

I don't see how to set report criteria in the report-to-pdf tool, but if I
can set the criteria before I use the tool, that should work.


I've never actually done it, but I think the idea was to
open the report in preview mode and then use Output or
whatever to create the PDF.

--
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:45 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.