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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|