It only inserts one record regardless of how any are selected.
I've been told three times that I have to execute the SQL inside the loop. I have tried everything I can think of but I just don't get how to do it.
Expand|Select|Wrap|Line Numbers
- Dim i As Variant
- Dim x As Variant
- Dim ParkValue As String, ConceptValue As String
- Dim sqlApprove As String
- With Me.ConceptList
- For Each i In Me.ConceptList.ItemsSelected
- 'ConceptValue = ConceptValue & ", " & Me.ConceptList.ItemData(i)
- ConceptValue = Me.ConceptList.ItemData(i)
- Next i
- With Me.ParkList
- For Each x In Me.ParkList.ItemsSelected
- ' ParkValue = ParkValue & ", " & Me.ParkList.ItemData(x)
- ParkValue = Me.ParkList.ItemData(x)
- Next x
- sqlApprove = "INSERT INTO TblFinal ( ParkID, ConceptID ) " & "VALUES('" & ParkValue & "','" & ConceptValue & "');"
- DoCmd.RunSQL sqlApprove
- End With
- End With
- End Sub