G
Guest
Using WinXP, Access2K2
Copyright Notice:
' This database and all the code therein is © 1999-2002 Arvin Meyer
(e-mail address removed)
' You are free to use this code and this database in an application
' as long as you do not publish it without the author's permission.
' Additionally, you are required to include this copyright notice in the
application.
The following code returns a list of developed reports to be sent via
E-mail. Some of the reports use different filter by form methods to bring up
the desired report. I would prefer not to have all reports be seen by the
user because the filter forms must be opened first to not have errors
presented.
Let's presume out of 12 reports, only two are developed without the use of
filtering forms. Is there a way to limit the list to the two reports?
I have tried to "Hide" the reports; Tools, Options, View, and uncheck
'Hidden Objects'. That only hides them in the database window, but not from
the code below.
Code Start **********************
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
Code End ***************************
Thanks for any suggestions.
Copyright Notice:
' This database and all the code therein is © 1999-2002 Arvin Meyer
(e-mail address removed)
' You are free to use this code and this database in an application
' as long as you do not publish it without the author's permission.
' Additionally, you are required to include this copyright notice in the
application.
The following code returns a list of developed reports to be sent via
E-mail. Some of the reports use different filter by form methods to bring up
the desired report. I would prefer not to have all reports be seen by the
user because the filter forms must be opened first to not have errors
presented.
Let's presume out of 12 reports, only two are developed without the use of
filtering forms. Is there a way to limit the list to the two reports?
I have tried to "Hide" the reports; Tools, Options, View, and uncheck
'Hidden Objects'. That only hides them in the database window, but not from
the code below.
Code Start **********************
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
Code End ***************************
Thanks for any suggestions.