By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

Unexpected error....

P: 72
istone (IS/IT--Management) Mar 1, 2007
Hi All,
I have a button in a form with the following code:
te Sub CmdGo_Click()
On Error GoTo Err_CmdGo_Click

Dim stDocName As String

DoCmd.SetWarnings False

DoCmd.RunSQL ("Delete from AANAME") 'AANAME
DoCmd.RunSQL ("Delete from AAProd") 'AAProd
DoCmd.RunSQL ("Delete from AALINK") 'AALINK
DoCmd.RunSQL ("Delete from AACTRN") 'AACTRN
DoCmd.RunSQL ("Delete from AAADDR") 'AAADDR

Dim qry As Variant
qry = Array("QryUpdateDBFAAprod", "QryUpdateDBFAANAME", "QryUpdateDBFAALINK", "QRYUpdateDBFaactrn", "QryUpdateDBFAAAddr")

Dim i As Integer

For i = 0 To 4
stDocName = qry(i)
'MsgBox qry(i)
DoCmd.OpenQuery stDocName, acNormal, acEdit
Next i
DoCmd.SetWarnings True
MsgBox "Build of Local Data for AA Complete", vbInformation, "Build AA Data"

Exit_CmdGo_Click:
Exit Sub

Err_CmdGo_Click:
MsgBox Err.Description
Resume Exit_CmdGo_Click

I run this code from my pc without a problem, but someone else get an error message when they run it from their pc. Here is the error:

Unexpected error from external database drive (10023)

your help is appreciated and thanks in advance
Mar 1 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Expand|Select|Wrap|Line Numbers
  1. Private Sub CmdGo_Click() 
  2. On Error GoTo Err_CmdGo_Click
  3. Dim stDocName As String
  4. Dim qry As Variant
  5.  Dim i As Integer
  6.  
  7. DoCmd.SetWarnings False
  8.  
  9. DoCmd.RunSQL ("Delete from AANAME") 'AANAME
  10. DoCmd.RunSQL ("Delete from AAProd") 'AAProd
  11. DoCmd.RunSQL ("Delete from AALINK") 'AALINK
  12. DoCmd.RunSQL ("Delete from AACTRN") 'AACTRN
  13. DoCmd.RunSQL ("Delete from AAADDR") 'AAADDR
  14.  
  15. qry = Array("QryUpdateDBFAAprod", "QryUpdateDBFAANAME", "QryUpdateDBFAALINK", "QRYUpdateDBFaactrn", "QryUpdateDBFAAAddr")
  16.  
  17. For i = 0 To 4
  18.     stDocName = qry(i)
  19.     'MsgBox qry(i)
  20.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  21. Next i
  22. DoCmd.SetWarnings True
  23. MsgBox "Build of Local Data for AA Complete", vbInformation, "Build AA Data"
  24.  
  25. Exit_CmdGo_Click:
  26.     Exit Sub
  27.  
  28. Err_CmdGo_Click:
  29.     MsgBox Err.Description
  30.     Resume Exit_CmdGo_Click
  31. End Sub
  32.  
At a guess I would say you are missing a library. In the VBA Editor go to Tools - References and check if any of the ticked libraries are marked as missing. If not check the list of ticked libraries against the list on your own PC.

Mary
Mar 1 '07 #2

P: 72
Worked. Thank you sooo much
Mar 1 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Worked. Thank you sooo much
No problem.
Mar 1 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.