I have a string in my code that keeps getting a code 13 error message when I run from my form. The form has a list box that displays and index field called testdetails_id which is an auto number field in testdetails_tbl. The 2nd field is called drawings which is part of drawings_tbl and is a text field which are linked in the testdetails_tbl by the drawing_id. I am getting the information for the list box from a query that takes in the the 3 tables. The data displayed is correct with regards to the drawings and test packages. My problem is when I run this code to delete selected drawings from the testdetails_tbl it errors say Type Mismatch on this string.
strIn = strIn & Me.List9!TestDetails_ID & ","
List9 is the correct list box. The full code used in the Event Procedure is:
Dim strIn As String
Dim varItm As Variant
Dim strSQL As String
For Each varItm In Me.List9.ItemsSelected
strIn = strIn & Me.List9!TestDetails_ID & ","
Next
strIn = Left(strIn, Len(strIn) - 1)
strIn = " Where [testdetails_id] In (" & strIn & ")"
strSQL = "DELETE * FROM testpackdetails_tbl" & strIn
CurrentDb.Execute strSQL, dbFailOnError
Very Perplexed with this one.
strIn = strIn & Me.List9!TestDetails_ID & ","
List9 is the correct list box. The full code used in the Event Procedure is:
Dim strIn As String
Dim varItm As Variant
Dim strSQL As String
For Each varItm In Me.List9.ItemsSelected
strIn = strIn & Me.List9!TestDetails_ID & ","
Next
strIn = Left(strIn, Len(strIn) - 1)
strIn = " Where [testdetails_id] In (" & strIn & ")"
strSQL = "DELETE * FROM testpackdetails_tbl" & strIn
CurrentDb.Execute strSQL, dbFailOnError
Very Perplexed with this one.