Copying

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
 
J

John Vinson

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.
 
A

ARMOUDIAN

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
 
J

John Vinson

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.
 

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

Similar Threads

Create a dynamic master file 1
COPYING FILE 0
PROBLEM WITH A FORM 1
COPYING 1
Search to a REPORT 1
PRINTING PROBLEMS 1
HELP--FORM PROBLEMS 1
HELP--WITH A FORM 0

Top