Hi
DoCmd.CopyObject (see below for syntax), but do you realise you can also 'link' tables, save you copying and duplicationg data, unless you specifically want to.
The CopyObject method carries out the CopyObject action in Visual Basic. For more information on how the action and its arguments work, see the action topic.
Syntax
DoCmd.CopyObject [destinationdatabase][, newname][, sourceobjecttype, sourceobjectname]
The CopyObject method has the following arguments.
Argument Description
destinationdatabase A string expression that's the valid path and file name for the database you want to copy the object into. To select the current database, leave this argument blank.
If you execute Visual Basic code containing the CopyObject method in a library database and leave this argument blank, Microsoft Access copies the object into the library database.
newname A string expression that's the new name for the object you want to copy. To use the same name if you are copying into another database, leave this argument blank.
sourceobjecttype One of the following intrinsic constants:
acDefault (default)
acForm
acMacro
acModule
acQuery
acReport
acTable
sourceobjectname A string expression that's the valid name of an object of the type selected by the sourceobjecttype argument.
If you run Visual Basic code containing the CopyObject method in a library database, Microsoft Access looks for the object with this name first in the library database, then in the current database.
Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now -
UK