I have a form with a combobox where I select the Carrier witch then populates a multiselect listbox with all the record from that carrier in the specified date. When I select them and click save I want all the record ID(ConID) saved under the same ID(manifest ID) ie,
1 223
1 225
2 344
2 4444
Ect
It saves it in a table called Manifest With the fields Manifest ID and CONID which is a lookup field to a different table
here is my current code for the on click command
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("Manifest", dbOpenDynaset)
If List21.ItemsSelected.Count = 0 Then
MsgBox "No Consignment notes selected"
GoTo Endme
End If
If IsNull(Combo17.Value) Then
MsgBox "No Carriers were selected"
GoTo Endme
End If
For Each row In List21.ItemsSelected
Conidval = List21.Column(0, row)
rs.AddNew
rs!ConID = Conidval
rs.Update
Next
Endme:
End Sub
Now ive done some searching and I thin dmax is what I want to use...but im not sure how to make it work