Extracting data from a report

G

GotaHeadache

We have many access databases at work. Each database may contain several
reports. I am trying to extract the report name and the report title for
each report, to be used in an inventory project.

I don't know much about vb code at all. I know that the labels and text
boxes I want to extract are in a controls collection, but not sure how to
write the code. Our report names are preceded by "Report ID:" literal.
There is nothing unique preceding the report title.

Can anyone offer some suggestions?

Thank you
 
B

Brian

Instead of using code, run a query against the table "MSysObjects". Look for
records where the type = -32764 (reports).

Try this for starters: create a new query, go to SQL view, paste in the
following statement, and then run the query:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

This should show you a list of all the reports in that database, sorted by
the report name. If you want it sorted, go back to design view in the query.
If you want to save it, change it to a make-table query and use it to create
a table called TableNames or something.

I'm sure someone else will know more than I do. I simply went to Tools ->
Options -> View -> Show Tab & checked "Hidden Objects". Then I went to
Tables, opened the MSysObjects table, and searched through the names for the
name of a known report. The type turned out to be -32764 for all reports, and
I am assuming this is consistent.
 
G

Gotaheadache

Brian,

Thanks for posting. I guess I didn't clearly state what I was looking
for. The report name and report title are labels within the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top