Copying the back-end to specific location.

J

James

I am trying to let the user copy the back-end to anywhere they want.
However, the program runs fine if you back-up to the default "C:\". If you
change the destination directory nothing it copied and the program still
shows "back-up succesful". What am I doing wrong?

---------start of code-------------
Option Compare Database
Option Explicit

Private Sub cmdBackup_Click()
On Error GoTo Err_cmdBackup_Click


FileCopy Me.txtSource, Me.txtDest
MsgBox "Backup Successful.", , "Card Account Manager 2005"

Exit_cmdBackup_Click:
Exit Sub

Err_cmdBackup_Click:
MsgBox Err.Description
Resume Exit_cmdBackup_Click

End Sub

Private Sub cmdBuildFile_Click()
Dim strFolder As String
strFolder = BrowseFolder("Please select a new folder for the backup file.")
If Not strFolder = vbNullString Then
Me.txtFolderPath = strFolder
End If
End Sub

Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click

DoCmd.Close

Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click

End Sub

Private Sub Form_Load()
On Error GoTo Err_Form_Load
Dim DataBE, DestinationFile
Dim datenow

datenow = Now()
DataBE = CurrentDBDir & "CAMBE.mdb"
DestinationFile = Me.txtFolderPath & "CAM2005BE" & Format(datenow,
"mmddyy") & ".bku"

Me.txtSource = DataBE
Me.txtDest = DestinationFile

Exit_Form_Load:
Exit Sub

Err_Form_Load:
MsgBox Err.Description
Resume Exit_Form_Load

End Sub

Private Sub txtFolderPath_BeforeUpdate(Cancel As Integer)
txtDest.Requery
End Sub
---------end of code----------------
 

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

Top