I'm having problems with the implementation of a progress bar that shows the percent rate of a backup that is being created. The code below connects to the back-end of my database and creates a backup at the designated path.
Private Sub Command103_Click()
Dim db As Database
Dim strSource As String, strDest As String, StrError As String
Dim strDate As String, strDateX As String
Set db = CurrentDb()
DoCmd.Hourglass True
strSource = db.TableDefs("Customers"
.Connect
strSource = Mid(strSource, 11, Len(strSource) - 10)
strDest = DLookup("Path", "Backup"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
FileCopy strSource, strDest
db.Close
DoCmd.Hourglass False
StrError = "A new backup has been created."
MsgBox StrError, vbInformation, "System Information"
DoCmd.RunCommand acCmdExit
Exit_Command103_Click:
Exit Sub
Err_Command103_Click:
Select Case Err.Number
Case 61
StrError = "Disk Full, No backup created."
MsgBox StrError, vbCritical, "System Information"
Kill strDest
Case 70
StrError = "Application in Use, No backup created."
MsgBox StrError, vbCritical, "Gestión y Control - Información del Sistema."
Case 76
StrError = "Unknown Path, No backup created."
MsgBox StrError, vbCritical, "Gestión y Control - Información del Sistema."
Forms![Menu].Visible = False
DoCmd.OpenForm "New Route"
Case Else
Err.Raise Err.Number, Err.DESCRIPTION
End Select
DoCmd.Hourglass False
Resume Exit_Command103_Click
End Sub
I've tried loads of different ways to get the progress bar to do its job, all I get is the default error "Application in Use, No backup created." The code for the progress bar was taken form: - Would anyone know how to implement/modify my code above to get the progress bar to show the percentage rate of the task in question? (P.S. I'm takling about Access2000 here)
Thanks in advance
Peps.
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)
Private Sub Command103_Click()
Dim db As Database
Dim strSource As String, strDest As String, StrError As String
Dim strDate As String, strDateX As String
Set db = CurrentDb()
DoCmd.Hourglass True
strSource = db.TableDefs("Customers"
strSource = Mid(strSource, 11, Len(strSource) - 10)
strDest = DLookup("Path", "Backup"
FileCopy strSource, strDest
db.Close
DoCmd.Hourglass False
StrError = "A new backup has been created."
MsgBox StrError, vbInformation, "System Information"
DoCmd.RunCommand acCmdExit
Exit_Command103_Click:
Exit Sub
Err_Command103_Click:
Select Case Err.Number
Case 61
StrError = "Disk Full, No backup created."
MsgBox StrError, vbCritical, "System Information"
Kill strDest
Case 70
StrError = "Application in Use, No backup created."
MsgBox StrError, vbCritical, "Gestión y Control - Información del Sistema."
Case 76
StrError = "Unknown Path, No backup created."
MsgBox StrError, vbCritical, "Gestión y Control - Información del Sistema."
Forms![Menu].Visible = False
DoCmd.OpenForm "New Route"
Case Else
Err.Raise Err.Number, Err.DESCRIPTION
End Select
DoCmd.Hourglass False
Resume Exit_Command103_Click
End Sub
I've tried loads of different ways to get the progress bar to do its job, all I get is the default error "Application in Use, No backup created." The code for the progress bar was taken form: - Would anyone know how to implement/modify my code above to get the progress bar to show the percentage rate of the task in question? (P.S. I'm takling about Access2000 here)
Thanks in advance
Peps.
![[sadeyes] [sadeyes] [sadeyes]](/data/assets/smilies/sadeyes.gif)