Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting report in MS Access

Status
Not open for further replies.

barovec

Programmer
Nov 28, 2006
3
US
I want to copy a report from one db to another, all tables have been exported already. Drag'n'drop does not work for me, I want some kind of script to do it programmatically.

Both databases are MS Access 2002 files.

Any help is highly appreciated.

Thanks,
barovec
 
'Import' or 'export' do not work for you?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I tried to export the report to xml file. I don't care about the data, so I exported only the schema. But I couldn't import it in the other db - nothing happens when I try to import it.

That's not what I want to do however. I want to have the same report in the second db. I am not sure if it's possible to do that programatically with some kind of script.

barovec
 
So you are trying to copy/move a report from one database to another? This is a one-off deal, meaning you don't need to do this everyday or anything?

Close BOTH databases. Open the one you want to put the report into...not the one where the report already exists. In the menu, select File -> Get External Data -> Import. Navigate to and select the database where the report already exists. Click the Reports tab, select the report and click OK.

The report should be copied into your new database....And you can copy any other object in the database this way :)

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Thanks. Actually there is much simpler way to do that: open both databases and just click on the report, then drag it and drop it in the other db. How about that? ;P

I want to do this without human interaction. This is part of automatic process to upgrade the second db. That's why I need some kind of script to copy the report.

However I don't have much experience w/ MS Access so I am not sure if that's doable.

barovec
 
I don't know when this function was added, but I think it was available by Access 2002....

Take a look at:

DoCmd.CopyObject [destinationdatabase][, newname], acReport, sourceobjectname]

I tested it by copying a report from one of my Access 2005 databases to another Access 2005 database, renaming the report in the process and it works flawlessly.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top