I have a form with 2 listboxes. lst1 is populated with staff names (first and last concatenated) from a query. Ii is set to mutli-select.
lst2 is populated with selections from lst1 (it is set to valuelist) using a cmd button with the following code:
This works fine but I wish I knew how to to switch the data back and fourth between the 2 listboxes-anyway
What I am trying to figure out is how to get the data from lst2 into a table named staff using another cmd button and having a vb yes/no pop up with the names of the staff picked so they can ensure they picked the right names.
I am still in the newbie stage of access so if I am going about this wrong let me know.
lst2 is populated with selections from lst1 (it is set to valuelist) using a cmd button with the following code:
Code:
Public Sub CopySelected(ByRef frm As Form) Dim ctlSource As Control Dim ctlDest As Control Dim strItems As String Dim intCurrentRow As Integer Set ctlSource = frm!lstsource Set ctlDest = frm!lstdestination For intCurrentRow = 0 To ctlSource.ListCount - 1 If ctlSource.Selected(intCurrentRow) Then strItems = strItems & ctlSource.Column(0, _ intCurrentRow) & ";" End If Next intCurrentRow ctlDest.RowSource = "" ctlDest.RowSource = strItems Set ctlSource = Nothing Set ctlDest = Nothing End Sub
What I am trying to figure out is how to get the data from lst2 into a table named staff using another cmd button and having a vb yes/no pop up with the names of the staff picked so they can ensure they picked the right names.
I am still in the newbie stage of access so if I am going about this wrong let me know.
Comment