Are you inside of the application?
If yes, then I would suggest that you use the compact feature.
The compact feature will ensure that no tables are open, and no other users
(or multiple copies) are running. Then, and only then will the copy proceed.
Further, since it is a compacted copy, and your will find that the size is
as small as it can/should be.
The code to do this is like:
Public Function MyCompactDB(strToFile As String) As Boolean
' compact to a db called "bak" in local dir...
dim strFromFile as string
On Error GoTo CompactDB_Error
strFromFile = currentdb.Name
' If Len(Dir(strToFile)) > 0 Then
' Kill strToFile
' End If
DBEngine.CompactDatabase strFromFile, strToFile
MyCompactDB = True
Exit Function
CompactDB_Error:
If Err.Number = 3356 Then
MsgBox "There are other users in the Data File" & vbCrLf & _
"(or you have more then one copy of program running)" & vbCrLf
& _
vbCrLf & _
"All other users must exit before you can complete this data" &
vbCrLf & _
"Maintenace on your data file" & vbCrLf & vbCrLf & _
"Please try again later", vbExclamation, AppName
Else
MsgBox "Unable to compact file" & vbCrLf & vbCrLf & _
"Error " & Err.Number & " (" & Err.Description & ")",
vbCritical, AppName
End If
End Function
To use, then you then go
if CompactMyDB = true then
' copy ok....
else
' copy was not ok
end if