Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another progress bar problem

Status
Not open for further replies.

Peps

Programmer
Feb 11, 2001
140
ES
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")
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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top