I am having an issue inserting listbox items into a table. I have the following code. Ihave a table with OrderNo, FilePath0, FilePath1,...File Path4. My users should be able to select up to 5 items, and have them copy the file paths into each field from the listbox.
I am getting a Run Time 3078 "The Microsoft Access database engine cannot find the input table or quesry 'False'. " The table name is correct and the link is refreshed. Any ideas? Is the code itself correct?
Code:
If Len(Me.lstAttach & vbNullString) = 0 Then
For i = 1 To Me.lstAttach.ListCount
strFileName = "E:\Databases-DO NOT MOVE\LE Tracking System\DefectAttach\" & Me.tbxOrderNum.Value & "-" & i
strListSource = Me.lstAttach.ListIndex = (i)
iAttachSQL = "INSERT INTO DefectAttach (OrderNo, FilePath" & (i) & ") VALUES (" & Me.tbxOrderNum & "," & Me.lstAttach.ListIndex = (i) & ");"
CurrentDb.Execute iAttachSQL
FileCopy strListSource, strFileName
Next i
Else
End If
I am getting a Run Time 3078 "The Microsoft Access database engine cannot find the input table or quesry 'False'. " The table name is correct and the link is refreshed. Any ideas? Is the code itself correct?