how to retrieve the report names from the MSysObjects

  • Thread starter Thread starter Guest
  • Start date Start date
You can do this by using the CurrentProject.AllReports collection, which
contains all the reports in the database. You can iterate through the items
in that collection.

Or you can run a query on the MSysObjects table (value of Type field in this
table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Thats really cool. What are some other Values for other object, such as
forms and queries?




Ken Snell (MVP) said:
You can do this by using the CurrentProject.AllReports collection, which
contains all the reports in the database. You can iterate through the
items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Forms as -32768, Macros are -32764, Modules are -32766.

Queries are 5.

Tables are one of 1, 4 or 6. 1 indicates that the table is in the same
database, 6 indicates that it's a "simple" linked table (either linked to
another Jet database, or to something like Excel, Text or dBase), while 4
indicates it's linked through ODBC.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


News said:
Thats really cool. What are some other Values for other object, such as
forms and queries?




Ken Snell (MVP) said:
You can do this by using the CurrentProject.AllReports collection, which
contains all the reports in the database. You can iterate through the
items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Thanks, very usefull info for me.

Vincent

Douglas J. Steele said:
Forms as -32768, Macros are -32764, Modules are -32766.

Queries are 5.

Tables are one of 1, 4 or 6. 1 indicates that the table is in the same
database, 6 indicates that it's a "simple" linked table (either linked to
another Jet database, or to something like Excel, Text or dBase), while 4
indicates it's linked through ODBC.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


News said:
Thats really cool. What are some other Values for other object, such as
forms and queries?




Ken Snell (MVP) said:
You can do this by using the CurrentProject.AllReports collection, which
contains all the reports in the database. You can iterate through the
items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Douglas -

Typo? You have the same number for macros as for reports?

--

Ken Snell
<MS ACCESS MVP>


Douglas J. Steele said:
Forms as -32768, Macros are -32764, Modules are -32766.

Queries are 5.

Tables are one of 1, 4 or 6. 1 indicates that the table is in the same
database, 6 indicates that it's a "simple" linked table (either linked to
another Jet database, or to something like Excel, Text or dBase), while 4
indicates it's linked through ODBC.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


News said:
Thats really cool. What are some other Values for other object, such as
forms and queries?




Ken Snell (MVP) said:
You can do this by using the CurrentProject.AllReports collection, which
contains all the reports in the database. You can iterate through the
items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Using Doug's terminology, I believe that these are the values for the
user-created objects:


1 Local tables (including system tables)

4 Complex linked tables (linked through ODBC)

5 Queries (including those for Row Source of comboboxes and
listboxes)

6 Simple linked tables (either linked to another Jet
database, or to
something like Excel, Text or dBase)

-32756 Pages (DAPs)

-32761 Modules

-32764 Reports

-32766 Macros

-32768 Forms

--

Ken Snell
<MS ACCESS MVP>



Ken Snell (MVP) said:
Douglas -

Typo? You have the same number for macros as for reports?

--

Ken Snell
<MS ACCESS MVP>


Douglas J. Steele said:
Forms as -32768, Macros are -32764, Modules are -32766.

Queries are 5.

Tables are one of 1, 4 or 6. 1 indicates that the table is in the same
database, 6 indicates that it's a "simple" linked table (either linked to
another Jet database, or to something like Excel, Text or dBase), while 4
indicates it's linked through ODBC.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


News said:
Thats really cool. What are some other Values for other object, such as
forms and queries?




You can do this by using the CurrentProject.AllReports collection,
which contains all the reports in the database. You can iterate through
the items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Looks like I did. Thanks, Ken. Should have been -32766

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Ken Snell (MVP) said:
Douglas -

Typo? You have the same number for macros as for reports?

--

Ken Snell
<MS ACCESS MVP>


Douglas J. Steele said:
Forms as -32768, Macros are -32764, Modules are -32766.

Queries are 5.

Tables are one of 1, 4 or 6. 1 indicates that the table is in the same
database, 6 indicates that it's a "simple" linked table (either linked to
another Jet database, or to something like Excel, Text or dBase), while 4
indicates it's linked through ODBC.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


News said:
Thats really cool. What are some other Values for other object, such as
forms and queries?




You can do this by using the CurrentProject.AllReports collection,
which contains all the reports in the database. You can iterate through
the items in that collection.

Or you can run a query on the MSysObjects table (value of Type field in
this table is -32764 for reports):

SELECT [Name] AS ReportName
FROM MSysObjects
WHERE [Type] = -32764;
 
Back
Top