Exporting multiple reports through VBA

K

Katrina

I have three copies of the same database.

The first copy is the master, it contains everything and
has limited access for data integrity. This is where we
make changes and updates to copy to the other 2.

The Second copy contains only the tables from the master.
This is in a read only directory so that no-one can change
the data.

The third copy has tables liked to the read only copy.
This third copy also has all of the reports and forms from
the master copied in.

It's set up like this so that "Group A" can add queries
and reports w/o being able to change the underlying data.

My problem is that every time we update the database, I
have to manually update the reports and forms. We have a
lot of reports and forms. As far as I can tell, I have
these options:

1. I can delete all the old reports from the 3rd version
and then import them all from the master (however, I have
to be careful not to delete the reports created by "Group
A")
2. I can export each of the reports one by one, which will
replace the old reports.


What I would like to do is find a command in visual basic
that will find all of the reports in the master and export
them all at once (thereby replacing the old reports) to
the 3rd copy. I do not want to call out the names of each
report, because then this will have to be updated anytime
I add a report.

Any Suggestions?

Please respond by post, my filter is set to only recieve
email from people in my address book, so i will not
recieve any emails sent to me.

Thanks for any help.
 
G

Glen Appleton

I believe the database type parameter needs to be in quotes:

DoCmd.TransferDatabase acExport, "Microsoft Access", _
\\server1\db\OurDB.mdb, acReport, objReport.Name, objReport.Name

And yes, you replace the db path and name with the one in which you want to
import the object. Once you work with VBA a bit more, you'll begin to get a
better feel for it.

- Glen
 
K

Katrina

I have the code exactly as posted below...

I have it set up as a button on a form. When I push the
button, it gives me the error "type mismatch"
Any more ideas?
Thank you so much for all your help, and sorry to keep
posting more...
 

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