Guys i have a problem with the code but dont know how to fix it.please help!this is the code.it said "run-time error '-2147217887 (80040e21) : multiple step generation errors.check each status value".the highlighted codes are at
VB Code:
  1. .Fields("Location").Value = dlgAdd.FileName
which is under command8_click()

this is the codes
VB Code:
  1. 'in General-Declarations:
  2. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
  3.     ByVal hWnd As Long, _
  4.     ByVal lpOperation As String, _
  5.     ByVal lpFile As String, _
  6.     ByVal lpParameters As String, _
  7.     ByVal lpDirectory As String, _
  8.     ByVal nShowCmd As Long) As Long
  9.  
  10. Private Sub Check1_Click()
  11. Check2.Enabled = False
  12.  
  13. Text7.Enabled = True
  14.  
  15. Command8.Enabled = True
  16.  
  17. Label13.Caption = Text4.Text
  18. Text8.Text = Label13.Caption
  19. End Sub
  20. Private Sub Check2_Click()
  21. Check1.Enabled = False
  22. Check3.Enabled = False
  23. Check4.Enabled = False
  24.  
  25. Command2.Enabled = True
  26.  
  27. Label15.Caption = Text10.Text
  28. Text8.Text = Label15.Caption
  29. End Sub
  30. Private Sub Check3_Click()
  31. Command2.Enabled = True
  32. Check4.Enabled = False
  33. Label14.Caption = Text6.Text
  34. Text9.Text = Label14.Caption
  35. End Sub
  36. Private Sub Check4_Click()
  37. Command2.Enabled = True
  38. Check3.Enabled = False
  39. Label16.Caption = Text11.Text
  40. Text9.Text = Label16.Caption
  41. End Sub
  42. Private Sub Command1_Click()
  43.  
  44. Adodc1.Recordset.AddNew
  45.  
  46. Text1.Enabled = True
  47. Text2.Enabled = True
  48. Text3.Enabled = True
  49.  
  50. Command4.Enabled = False
  51. Command1.Enabled = False
  52. Command5.Enabled = True
  53. Command7.Enabled = True
  54.  
  55. Check1.Enabled = True
  56. Check2.Enabled = True
  57. Check3.Enabled = True
  58. Check4.Enabled = True
  59.  
  60. End Sub
  61. Private Sub Command2_Click()
  62.  
  63. Adodc1.Recordset.Update
  64.  
  65. Text1.Enabled = False
  66. Text2.Enabled = False
  67. Text3.Enabled = False
  68.  
  69. Command4.Enabled = True
  70. Command1.Enabled = False
  71. Command2.Enabled = False
  72. Command6.Enabled = True
  73. Command5.Enabled = False
  74. Command7.Enabled = False
  75.  
  76. Check1.Enabled = False
  77. Check2.Enabled = False
  78. Check3.Enabled = False
  79. Check4.Enabled = False
  80.  
  81. End Sub
  82.  
  83. Private Sub Command3_Click()
  84.  
  85. With Form6.Adodc1.Recordset
  86.     If .BOF Then Form6.Command1.Enabled = False
  87.     If .BOF Then Form6.Command5.Enabled = False
  88. End With
  89.  
  90. Unload Form12
  91. Load Form6
  92. Form6.Show
  93.  
  94. End Sub
  95. Private Sub Command4_Click()
  96.  
  97. Form13.Text2.Enabled = False
  98. Form13.Text3.Enabled = False
  99. Form13.Text4.Enabled = False
  100. Form13.Text5.Enabled = False
  101. Form13.Text7.Enabled = False
  102.  
  103. Form13.Check1.Enabled = False
  104. Form13.Check3.Enabled = False
  105. Form13.Check2.Enabled = False
  106. Form13.Check4.Enabled = False
  107.  
  108. Form13.cmdAdd.Enabled = False
  109. Form13.Command2.Enabled = False
  110. Form13.Command4.Enabled = False
  111. Form13.Command5.Enabled = False
  112. Form13.Command6.Enabled = False
  113. Form13.Command7.Enabled = False
  114.  
  115. Load Form13
  116. Form13.Label10.Caption = Text2.Text
  117. Form13.Label11.Caption = Text1.Text
  118. Unload Form12
  119. Form13.Show
  120.  
  121. End Sub
  122. Private Sub Command5_Click()
  123.  
  124.     Dim bytData() As Byte
  125.     Dim strDescription As String
  126.    
  127.     On Error GoTo err
  128.    
  129.     With dlgAdd 'remember the common dialog box.
  130.    
  131.         .CancelError = False
  132.         .Filter = "Picture Files (*.jpg, *.gif)|*.jpg;*.gif" 'filtering so only jpg's and gifs are shown!
  133.         .DialogTitle = "Select Picture" 'sets the title of it.
  134.         .ShowOpen ' show the open dialog box.
  135.            
  136.        
  137.         Open .FileName For Binary As #1  'bit to "convert" the image to binary.
  138.         ReDim bytData(FileLen(.FileName))
  139.     End With
  140.    
  141.    
  142.     Get #1, , bytData
  143.     Close #1
  144.    
  145.     With Adodc1.Recordset
  146.         .Fields("Picture").AppendChunk bytData 'adding the picture to the db
  147.     End With
  148.    
  149.     Exit Sub
  150. err:
  151.     If err.Number = 32755 Then     'simple error check.
  152.     Else
  153.         MsgBox err.Description
  154.         err.Clear
  155.     End If
  156.  
  157. End Sub
  158. Private Sub OLE1_Updated(Code As Integer)
  159.  
  160. End Sub
  161. Private Sub Command6_Click()
  162.  
  163. Form9.Adodc1.Recordset.Filter = "Code/Model='" & Label10.Caption & "'"
  164. Form9.Command1.Visible = False
  165. Form9.Command3.Visible = False
  166.  
  167. Load Form9
  168. Form9.Show
  169.  
  170. End Sub
  171. Private Sub Command7_Click()
  172.  
  173. Adodc1.Recordset.CancelUpdate
  174.  
  175. Text1.Enabled = False
  176. Text2.Enabled = False
  177. Text3.Enabled = False
  178. Text7.Enabled = False
  179.  
  180. Check1.Enabled = False
  181. Check2.Enabled = False
  182. Check3.Enabled = False
  183. Check4.Enabled = False
  184.  
  185. Command2.Enabled = False
  186. Command4.Enabled = False
  187. Command6.Enabled = False
  188. Command5.Enabled = False
  189. Command1.Enabled = True
  190. Command7.Enabled = False
  191.  
  192. End Sub
  193.  
  194. Private Sub Command8_Click()
  195.  
  196. With dlgAdd
  197.     .CancelError = False
  198.     .Filter = "Drawing Files (*.prt)|*.xls|All Files (*.*)|*.*|"
  199.     .ShowOpen
  200. End With
  201.  
  202. With Adodc1.Recordset
  203.     .Fields("Location").Value = dlgAdd.FileName
  204. End With
  205.  
  206. Exit Sub
  207. err:
  208.     If err.Number = 32755 Then     'simple error check.
  209.     Else
  210.         MsgBox err.Description
  211.         err.Clear
  212.     End If
  213.  
  214. End Sub

please help me coz I need to show this to my supervisor tomorrow.thanks very much!