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

Export to Snapshot with parameters



 
 
Thread Tools Display Modes
  #1  
Old December 10th, 2008, 12:15 AM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default Export to Snapshot with parameters

I have report wich runs 1) filtered by the ClientID value from the form it
runs from (by strWhere criteria in its VBA code) and 2) filtered by
date-range from the same form (the Date field of the report' query has the
parameters wich "catch" StartDate and EndDate entered in the form).
I run the report by either of 2 buttons with acPreview and acNormal VBA
commands (for viewing and printing respectively) .

Now I've added button programmed with built-in Acces Macro OutputTo command
to export the report directly to Shapshot. But it does not take care of the 2
mentioned filters.

How can I fix the Macro or maybe put VBA code instead to export the report
directly to Snapshot without previewing having both conditions executed?
  #2  
Old December 10th, 2008, 05:27 PM posted to microsoft.public.access.gettingstarted
Dale Fye
external usenet poster
 
Posts: 2,651
Default Export to Snapshot with parameters

instead of using the WHERE clause of the OpenReport method to filter the
reports recordset, you need to actually imbed these values in the reports
underlying query.
So, instead of a query that looks like:

SELECT * FROM myTable

you would do something like:

SELECT * FROM myTable
WHERE [DateField] = [Forms]!formName.txtStartDate
AND [DateField] = [Forms]!formName.txtEndDate

You may need to declare these form fields as parameters (dates). If you
don't know how to do this, post back and I'll provide some instructions.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

I have report wich runs 1) filtered by the ClientID value from the form it
runs from (by strWhere criteria in its VBA code) and 2) filtered by
date-range from the same form (the Date field of the report' query has the
parameters wich "catch" StartDate and EndDate entered in the form).
I run the report by either of 2 buttons with acPreview and acNormal VBA
commands (for viewing and printing respectively) .

Now I've added button programmed with built-in Acces Macro OutputTo command
to export the report directly to Shapshot. But it does not take care of the 2
mentioned filters.

How can I fix the Macro or maybe put VBA code instead to export the report
directly to Snapshot without previewing having both conditions executed?

  #3  
Old December 10th, 2008, 08:08 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default Export to Snapshot with parameters

hi dale
I've already had your method for the date values, but the ClientID indeed
was passed thru WHERE clause, wich worked for previewing and printing to MS
Document Imaging, but not for exporting (why?).
Now I've implemented this for the ClientID as well - and this made the trick.
Thanks a lot!


"Dale Fye" wrote:

instead of using the WHERE clause of the OpenReport method to filter the
reports recordset, you need to actually imbed these values in the reports
underlying query.
So, instead of a query that looks like:

SELECT * FROM myTable

you would do something like:

SELECT * FROM myTable
WHERE [DateField] = [Forms]!formName.txtStartDate
AND [DateField] = [Forms]!formName.txtEndDate

You may need to declare these form fields as parameters (dates). If you
don't know how to do this, post back and I'll provide some instructions.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

I have report wich runs 1) filtered by the ClientID value from the form it
runs from (by strWhere criteria in its VBA code) and 2) filtered by
date-range from the same form (the Date field of the report' query has the
parameters wich "catch" StartDate and EndDate entered in the form).
I run the report by either of 2 buttons with acPreview and acNormal VBA
commands (for viewing and printing respectively) .

Now I've added button programmed with built-in Acces Macro OutputTo command
to export the report directly to Shapshot. But it does not take care of the 2
mentioned filters.

How can I fix the Macro or maybe put VBA code instead to export the report
directly to Snapshot without previewing having both conditions executed?

  #4  
Old December 10th, 2008, 08:26 PM posted to microsoft.public.access.gettingstarted
Dale Fye
external usenet poster
 
Posts: 2,651
Default Export to Snapshot with parameters

Well, maybe because the OutputTo method does not support a Filter or Where
clause, like the OpenReport method does.

Who knows why Microsoft does what they do. But this is definately a
capability I would have put in the OutputTo method.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

hi dale
I've already had your method for the date values, but the ClientID indeed
was passed thru WHERE clause, wich worked for previewing and printing to MS
Document Imaging, but not for exporting (why?).
Now I've implemented this for the ClientID as well - and this made the trick.
Thanks a lot!


"Dale Fye" wrote:

instead of using the WHERE clause of the OpenReport method to filter the
reports recordset, you need to actually imbed these values in the reports
underlying query.
So, instead of a query that looks like:

SELECT * FROM myTable

you would do something like:

SELECT * FROM myTable
WHERE [DateField] = [Forms]!formName.txtStartDate
AND [DateField] = [Forms]!formName.txtEndDate

You may need to declare these form fields as parameters (dates). If you
don't know how to do this, post back and I'll provide some instructions.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

I have report wich runs 1) filtered by the ClientID value from the form it
runs from (by strWhere criteria in its VBA code) and 2) filtered by
date-range from the same form (the Date field of the report' query has the
parameters wich "catch" StartDate and EndDate entered in the form).
I run the report by either of 2 buttons with acPreview and acNormal VBA
commands (for viewing and printing respectively) .

Now I've added button programmed with built-in Acces Macro OutputTo command
to export the report directly to Shapshot. But it does not take care of the 2
mentioned filters.

How can I fix the Macro or maybe put VBA code instead to export the report
directly to Snapshot without previewing having both conditions executed?

  #5  
Old December 10th, 2008, 09:31 PM posted to microsoft.public.access.gettingstarted
Mishanya
external usenet poster
 
Posts: 197
Default Export to Snapshot with parameters

100%!

"Dale Fye" wrote:

Well, maybe because the OutputTo method does not support a Filter or Where
clause, like the OpenReport method does.

Who knows why Microsoft does what they do. But this is definately a
capability I would have put in the OutputTo method.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

hi dale
I've already had your method for the date values, but the ClientID indeed
was passed thru WHERE clause, wich worked for previewing and printing to MS
Document Imaging, but not for exporting (why?).
Now I've implemented this for the ClientID as well - and this made the trick.
Thanks a lot!


"Dale Fye" wrote:

instead of using the WHERE clause of the OpenReport method to filter the
reports recordset, you need to actually imbed these values in the reports
underlying query.
So, instead of a query that looks like:

SELECT * FROM myTable

you would do something like:

SELECT * FROM myTable
WHERE [DateField] = [Forms]!formName.txtStartDate
AND [DateField] = [Forms]!formName.txtEndDate

You may need to declare these form fields as parameters (dates). If you
don't know how to do this, post back and I'll provide some instructions.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"Mishanya" wrote:

I have report wich runs 1) filtered by the ClientID value from the form it
runs from (by strWhere criteria in its VBA code) and 2) filtered by
date-range from the same form (the Date field of the report' query has the
parameters wich "catch" StartDate and EndDate entered in the form).
I run the report by either of 2 buttons with acPreview and acNormal VBA
commands (for viewing and printing respectively) .

Now I've added button programmed with built-in Acces Macro OutputTo command
to export the report directly to Shapshot. But it does not take care of the 2
mentioned filters.

How can I fix the Macro or maybe put VBA code instead to export the report
directly to Snapshot without previewing having both conditions executed?

 




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