claycalgary
New member
- Local time
- Today, 03:38
- Joined
- Sep 28, 2009
- Messages
- 2
Hello
I am having difficulty here. I am trying to write code that will run a daily report for 170 producers, referenced by there number
The macro should be running the report 170 times. Here is what I have.
Option Explicit
Sub Run_Daily_Variance_Reports()
Dim I As Integer
Dim Producer As Variant
Producer = Array("100:270")
For I = LBound(Producer) To UBound(Producer)
DoCmd.OpenReport "Variance_by_Producer_Detail", acViewPreview, "",
"[Reports].[Variance_by_Producer_Detail].[Producer_#]='" & Producer(I)&"'"
Next I
End Sub
When I run the code however, the producer_# will not pass through the the report and no data will appear in the report. The report is generated from a query.
Thanks
Clay
I am having difficulty here. I am trying to write code that will run a daily report for 170 producers, referenced by there number
The macro should be running the report 170 times. Here is what I have.
Option Explicit
Sub Run_Daily_Variance_Reports()
Dim I As Integer
Dim Producer As Variant
Producer = Array("100:270")
For I = LBound(Producer) To UBound(Producer)
DoCmd.OpenReport "Variance_by_Producer_Detail", acViewPreview, "",
"[Reports].[Variance_by_Producer_Detail].[Producer_#]='" & Producer(I)&"'"
Next I
End Sub
When I run the code however, the producer_# will not pass through the the report and no data will appear in the report. The report is generated from a query.
Thanks
Clay