By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,101 Members | 971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,101 IT Pros & Developers. It's quick & easy.

Access ADO Report List

P: n/a
I tried using this code to populate a list box with a list of reports
in my Access2k.ADP project, but it says MSysObjects is not valid
object name.
Any help is appreciated.
lq

Dim rs As New ADODB.Recordset, myStr As String
Dim i As Integer
rs.CursorLocation = adUseClient
rs.Open "Select Name from MSysObjects where Type = -32764",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
For i = 0 To (rs.RecordCount - 1)
If rs.EOF = False Then
myStr = ";" & myStr & rs.Fields(0).Value
rs.MoveNext
End If
Next i
Me.ListBox.RowSource = Mid(myStr, 2)
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Lauren Quantrell wrote:
I tried using this code to populate a list box with a list of reports
in my Access2k.ADP project, but it says MSysObjects is not valid
object name.

< SNIP >
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
MSysObjects is not in an .adp file. Use the AllReports collection.
E.g. (from the help file):

Sub AllReports()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
If obj.IsLoaded = True Then
' Print name of obj.
Debug.Print obj.Name
End If
Next obj
End Sub

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQGzUm4echKqOuFEgEQLbKgCg553PhJSxPi8vIGDjuNanHF PRlroAoM5z
4LccuoaviuIJSBHlprHVRmvL
=xu/1
-----END PGP SIGNATURE-----

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.