Copying

  • Thread starter Thread starter ARMOUDIAN
  • Start date Start date
A

ARMOUDIAN

I want to copy everything from the database every three
months with a different destination file.

How do we write a code for that and can it be done
through a macro.

Adam Armoudian
(e-mail address removed)
580.819.1188
 
I want to copy everything from the database every three
months with a different destination file.

Everything? All the Forms, Reports, queries, VBA code, macros?
How do we write a code for that and can it be done
through a macro.

Again... If you want to copy an entire database you CANNOT do it from
within that database. You cannot do it using Macros, you cannot do it
using VBA, you cannot do it manually - YOU JUST CANNOT DO IT.

If you want to copy an entire database, you must - no option that I
know of! - close Access and use Windows Explorer or a batch file to
copy the database file.
 
I do not know how to do it in a macro but here is the code
John,

Someone wrote this to me:


Private Sub Command10_Click()
This works even if you are in the application

Dim fso As Variant
Dim boverwrite As Boolean

Set fso = CreateObject("Scripting.fileSystemObject")

fso.copyfile "sourcefile", "destinationfile"

End Sub

Jim
 
Dim boverwrite As Boolean

Set fso = CreateObject("Scripting.fileSystemObject")

fso.copyfile "sourcefile", "destinationfile"

End Sub

Jim

Yes. This will work.

If any table is open for editing, through a Form or otherwise; or if
any Form or Report is open in design mode, the destinationfile can be
pretty much guaranteed to be irretrievably corrupt.

If that's an acceptable price to pay, go right ahead.
 
Back
Top