D J
asked on
MS Access Why do I need the ID in my list box for my code to work?
If I don't have the DRAWINGSID in my list box - row source - query builder in the 1st position the code below will not execute.
How do I get this function to work without displaying the DRAWINGSID in my list box?
How do I get this function to work without displaying the DRAWINGSID in my list box?
Private Sub Command4_Click()
On Error Resume Next
Dim varList0 As Variant, varList2 As Variant
Dim strSQL As String
For Each varList0 In Me.List0.ItemsSelected
For Each varList2 In Me.List2.ItemsSelected
strSQL = "INSERT INTO tbl_HullJoin (CRAFTSID, DRAWINGSID) " _
& "Values (" & Me.List0.ItemData(varList0) & ", " _
& Me.List2.ItemData(varList2) & ")"
CurrentDb.Execute strSQL, dbFailOnError
Next varList2
Next varList0
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER