Make a copy of DB and move it (1 Viewer)

g-richardson

Registered User.
Local time
Today, 09:26
Joined
Mar 4, 2005
Messages
42
Hi,

I am trying to continue the process described below. We are taking a query from an active database and creating a table in a remote db in the network...we want to take the next step in the process to now copy the destination database and have the user save it to a location of their choosing so they can manipulate the data...

The code so far (works great...)

If [Forms]![frm_ProductSelect]![chkDetail2EXLRpt] Then
DoCmd.OpenReport "RPT_Dashboard_FULL_REPORT", acViewPreview
'DoCmd.OpenQuery "qry_PolLevelDetail"
'DoCmd.RunCommand acCmdExport
'DoCmd.Close acQuery, "PolLevelDetail"
DoCmd.TransferDatabase acExport, "Microsoft Access", _
"\\bostvfs01\data1\Access\Dashboard\UL\PolDetail.mdb", acTable, _
"PolLevelDetail", "PolDetail" & [Forms]![frm_ProductSelect]![Product], 0
msgbox "Export done"
End If



Any help appreciated.
 

Moniker

VBA Pro
Local time
Today, 08:26
Joined
Dec 21, 2006
Messages
1,567
Have you investigated this command:

DoCmd.CopyObject

Full Description:
DoCmd.CopyObject(DestinationDatabase, NewName, SourceObjectType, SourceObjectName)

I believe that will do what you want. To get the DestinationDatabase (where you want to save the DB), you can use a FileDialog object, which will require a reference to the Office X.0 Object Library. That will expose the standard file dialog boxes the users are already familiar with and allow them to select a path to save to.
 

g-richardson

Registered User.
Local time
Today, 09:26
Joined
Mar 4, 2005
Messages
42
Moniker...THANKS so much. I found this same solution independent of this forum and forgot to come back to check it out. Thanks again for the spot on advice. Great job.
 

Users who are viewing this thread

Top Bottom