...or you can drop common dialog control on your form and then use DAO and a modified version of the following code to ask the user where to place the backup copy and then create the backup copy via DatabaseCompact which has the advantage of creating the smallest possible file.
Code:
Public Function CreateDB() As Boolean
'***************************************************************************
'Purpose: Create the extract database via CompactDatabase
'Inputs: None
'Outputs: None
'***************************************************************************
Dim wrkDefault As Workspace
frmExtract.dlgMDB.CancelError = True
frmExtract.dlgMDB.DefaultExt = "MDB"
frmExtract.dlgMDB.Filter = "Test Case Database Files(*.MDB)|*.MDB"
On Error Resume Next
frmExtract.dlgMDB.Flags = cdlOFNOverwritePrompt Or cdlOFNExtensionDifferent Or cdlOFNPathMustExist
frmExtract.dlgMDB.Action = 2
If Err = 32755 Then 'Cancel
Err.Clear
CreateDB = False
Exit Function
End If
On Error GoTo ErrorRoutine
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
' Make sure there isn't already a file with the name of
' the new database.
If Dir(frmExtract.dlgMDB.FileName) <> "" Then
Kill frmExtract.dlgMDB.FileName
End If
g_dbRWTU.Close
DBEngine.CompactDatabase "c:\rwt\data\rwtu.mdb", frmExtract.dlgMDB.FileName
CreateDB = True
Exit Function
ErrorRoutine:
CreateDB = False
DisplayError "CreateDB", "Error", vbCritical
End Function
To use the above you will want to delete the g_dbRWTU.Close
line, change the hard-coded database name in the CompactDatabase line, and change the ErrorRoutine to suit yourself.