I can store records in the DB by using combobox with the following code. Here single part number is selected and partnumber related data is stored in the DB table.
But I want the code for Listbox...When I select multiple partnumbers ..how can I store in the DB table?
Case "Pn ADDED to Wrapper", _
"Pn REMOVED from Wrapper"
If Me!PartNumber <> "All" And Me!PartNumber <> "Select" Then ' a proper part number has been selected in combo box
strNewSq5 = _
"INSERT INTO tblTmpEventLog (TrackingNumber,PartNumber,PartNumberChgLvl,EnteredBy,EventTypeSelected,EventDate)"
strNewSq5 = strNewSq5 & " VALUES ('" & tempTrackingNumber & "','" & _
tempPartNumber & "','" & _
tempPartNumberChgLvl & "','" & _
tempEnteredBy & "','" & _
tempEventTypeSelected & "'," & _
"#" & Forms!frmEventLog_Input.EventDate & "#)"
dbs.Execute strNewSq5, dbFailOnError
TrnsfTmpEventToEventLog
Else
displayMsgBox = MsgBox("A single part number must be specified. Please correct.", vbCritical, "System Error")
Exit Sub
End If