OrWolf
MIS
- Mar 19, 2001
- 291
Hi there,
I have a detail form with a list box that need to be able to allow a user to select multiple entries. I was able to find the code to store the values in the child table, however that code is missing the option to remove values that are unselected. Also I don't have the code necessary to show the values that were previously selected. Does anyone have an example of this?
My AfterUpdate code:
Dim varItem As Variant
Dim rs As New ADODB.Recordset
rs.Open "Complaints_Trend_code", CurrentProject.Connection, adOpenStatic, adLockOptimistic
For Each varItem In Me.List2.ItemsSelected
rs.AddNew
rs!ComplaintGuid = Me.ComplaintGuid
rs!Trend_code = Me.List2.ItemData(varItem)
rs.Update
Next varItem
rs.Close
Set rs = Nothing
End Sub
Thank you
I have a detail form with a list box that need to be able to allow a user to select multiple entries. I was able to find the code to store the values in the child table, however that code is missing the option to remove values that are unselected. Also I don't have the code necessary to show the values that were previously selected. Does anyone have an example of this?
My AfterUpdate code:
Dim varItem As Variant
Dim rs As New ADODB.Recordset
rs.Open "Complaints_Trend_code", CurrentProject.Connection, adOpenStatic, adLockOptimistic
For Each varItem In Me.List2.ItemsSelected
rs.AddNew
rs!ComplaintGuid = Me.ComplaintGuid
rs!Trend_code = Me.List2.ItemData(varItem)
rs.Update
Next varItem
rs.Close
Set rs = Nothing
End Sub
Thank you