M
Matt Tatham
I'm hoping someone out there can help me with this.
I have several databases created using Access 2000. I'm using a transfer
utility developed by a contractor of some years ago for our company to update
the production databases we have at remote locations. I have used it without
error or problem for two years and it started hanging up, giving me this
error:
Run-time error '2501'
TransferDatabase was cancelled
I've been running through the knowledge base and online help to try and find
out why this was occurring. All I've been able to do so far is trap the
error and exit gracefully. My code originally looked like this:
Private Sub Command0_Click()
MsgBox "start"
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acModule, "Global", "Global", False
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acForm, "Schedule", "Schedule", False
MsgBox "finished"
End Sub
Using the help I found online, I added error trapping thusly:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
MsgBox "start"
DoCmd.TransferDatabase (acExport), "Microsoft Access", "\H:\MfgInfo.mdb",
acModule, "Global", "Global", False
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acForm, "Schedule", "Schedule", False
MsgBox "finished"
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
If Err.Number = 2501 Then
MsgBox "IS 2501"
Resume Exit_Command0_Click
Else
MsgBox "NOT 2501"
Resume Exit_Command0_Click
End If
End Sub
I can now see when the error occurs and my program doesn't crash, but I have
zero information on why the error is occurring and how I can resolve it so
that the TransferDatabase can actually function.
Any help is greatly appreciated.
Matt Tatham
I have several databases created using Access 2000. I'm using a transfer
utility developed by a contractor of some years ago for our company to update
the production databases we have at remote locations. I have used it without
error or problem for two years and it started hanging up, giving me this
error:
Run-time error '2501'
TransferDatabase was cancelled
I've been running through the knowledge base and online help to try and find
out why this was occurring. All I've been able to do so far is trap the
error and exit gracefully. My code originally looked like this:
Private Sub Command0_Click()
MsgBox "start"
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acModule, "Global", "Global", False
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acForm, "Schedule", "Schedule", False
MsgBox "finished"
End Sub
Using the help I found online, I added error trapping thusly:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
MsgBox "start"
DoCmd.TransferDatabase (acExport), "Microsoft Access", "\H:\MfgInfo.mdb",
acModule, "Global", "Global", False
DoCmd.TransferDatabase (acExport), "Microsoft Access", "H:\MfgInfo.mdb",
acForm, "Schedule", "Schedule", False
MsgBox "finished"
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
If Err.Number = 2501 Then
MsgBox "IS 2501"
Resume Exit_Command0_Click
Else
MsgBox "NOT 2501"
Resume Exit_Command0_Click
End If
End Sub
I can now see when the error occurs and my program doesn't crash, but I have
zero information on why the error is occurring and how I can resolve it so
that the TransferDatabase can actually function.
Any help is greatly appreciated.
Matt Tatham