Hi.
Please (PLEASE) tell me what I'm doing wrong here...
<begin code>
Private Sub cmdPrtCallDetailPerAU_Click()
On Error GoTo Err_cmdPrtCellDetailPerAU_Click
Dim stDocName As String
Dim db As Database
Dim rs As Recordset
Dim i As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT au_list.au_list FROM au_list;"
rs.MoveLast
rs.MoveFirst
For i = 0 To rs.RecordCount - 1
DoCmd.CopyObject , "CellDetail" & rs!au_list, acReport, "rptVerizonCallDetail"
stDocName = "CellDetail" & rs!au_list
DoCmd.OpenReport stDocName, acNormal, , "txtBureau = '" & rs!au_list & "'"
DoCmd.DeleteObject acReport, stDocName
rs.MoveNext
Next i
Exit_cmdPrtCellDetailPerAU_Click:
Exit Sub
Err_cmdPrtCellDetailPerAU_Click:
MsgBox Err.Description
Resume Exit_cmdPrtCallDetailPerAU_Click
End Sub
<end code>
All I want is one pdf for each "AU" from the AU_LIST table. When I run this code, it calls EVERYTHING "rptVerizonCallDetail" and it does not read the correct AU from the "txtBureau" control (which is hidden) on the report. Is this because the control is hidden?
I'm in Access97 on a Win2K box. THANK YOU, THANK YOU for your help
PenelopeC
~~~>-/O~~~~~swimming right along
Please (PLEASE) tell me what I'm doing wrong here...
<begin code>
Private Sub cmdPrtCallDetailPerAU_Click()
On Error GoTo Err_cmdPrtCellDetailPerAU_Click
Dim stDocName As String
Dim db As Database
Dim rs As Recordset
Dim i As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT au_list.au_list FROM au_list;"
rs.MoveLast
rs.MoveFirst
For i = 0 To rs.RecordCount - 1
DoCmd.CopyObject , "CellDetail" & rs!au_list, acReport, "rptVerizonCallDetail"
stDocName = "CellDetail" & rs!au_list
DoCmd.OpenReport stDocName, acNormal, , "txtBureau = '" & rs!au_list & "'"
DoCmd.DeleteObject acReport, stDocName
rs.MoveNext
Next i
Exit_cmdPrtCellDetailPerAU_Click:
Exit Sub
Err_cmdPrtCellDetailPerAU_Click:
MsgBox Err.Description
Resume Exit_cmdPrtCallDetailPerAU_Click
End Sub
<end code>
All I want is one pdf for each "AU" from the AU_LIST table. When I run this code, it calls EVERYTHING "rptVerizonCallDetail" and it does not read the correct AU from the "txtBureau" control (which is hidden) on the report. Is this because the control is hidden?
I'm in Access97 on a Win2K box. THANK YOU, THANK YOU for your help
PenelopeC
~~~>-/O~~~~~swimming right along