K
Keypad
Hello all,
I have the following code that allows me to send multiple reports to
multiple email recipients which works fine in Office 2003 but not Office
2007. In 2007 my reports don't show up in my control window, everything else
seems fine. I don't have Office 2007 so I can't troubleshoot the problem.
Can someone with 2007 load this code and see if works for them.
Here's the code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_OF
Dim db As Database
Dim i As Integer
Dim contr As Container
Dim strRptList As String
Dim strRptName As String
Dim Length As Integer
Set db = CurrentDb()
Set contr = db.Containers("Reports")
strRptList = ""
For i = 0 To contr.Documents.Count - 1
strRptName = contr.Documents(i).name
If strRptList <> "" Then strRptList = strRptList & "; "
Length = Len(strRptName)
strRptList = strRptList & strRptName
Next i
Me!lstRpt.RowSource = strRptList
Exit_OF:
Exit Sub
Err_OF:
MsgBox Err & " " & Error, , "Report Open"
Resume Exit_OF
End Sub
I have the following code that allows me to send multiple reports to
multiple email recipients which works fine in Office 2003 but not Office
2007. In 2007 my reports don't show up in my control window, everything else
seems fine. I don't have Office 2007 so I can't troubleshoot the problem.
Can someone with 2007 load this code and see if works for them.
Here's the code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_OF
Dim db As Database
Dim i As Integer
Dim contr As Container
Dim strRptList As String
Dim strRptName As String
Dim Length As Integer
Set db = CurrentDb()
Set contr = db.Containers("Reports")
strRptList = ""
For i = 0 To contr.Documents.Count - 1
strRptName = contr.Documents(i).name
If strRptList <> "" Then strRptList = strRptList & "; "
Length = Len(strRptName)
strRptList = strRptList & strRptName
Next i
Me!lstRpt.RowSource = strRptList
Exit_OF:
Exit Sub
Err_OF:
MsgBox Err & " " & Error, , "Report Open"
Resume Exit_OF
End Sub