G
Guest
I am using the below function to select multiple values in one listbox and
place them into another listbox on the same form. When I close the form, I am
trying to take the multiple values and save them into an applicable field in
the associated table. I can get all the other textbox fields to save, but not
this part.
Thanks in advance
Function CopySelected(frm As Form) As Integer
Dim ctlsource As Control
Dim ctldest As Control
Dim stritems As String
Dim intCurrentRow As Integer
Set ctlsource = frm!List20
Set ctldest = frm!lstDestination
For intCurrentRow = 0 To ctlsource.ListCount - 1
If ctlsource.Selected(intCurrentRow) Then
stritems = stritems & ctlsource.Column(1, _
intCurrentRow) & ";"
End If
Next intCurrentRow
' Reset destination control's RowSource property.
ctldest.RowSource = ""
ctldest.RowSource = stritems
End Function
place them into another listbox on the same form. When I close the form, I am
trying to take the multiple values and save them into an applicable field in
the associated table. I can get all the other textbox fields to save, but not
this part.
Thanks in advance
Function CopySelected(frm As Form) As Integer
Dim ctlsource As Control
Dim ctldest As Control
Dim stritems As String
Dim intCurrentRow As Integer
Set ctlsource = frm!List20
Set ctldest = frm!lstDestination
For intCurrentRow = 0 To ctlsource.ListCount - 1
If ctlsource.Selected(intCurrentRow) Then
stritems = stritems & ctlsource.Column(1, _
intCurrentRow) & ";"
End If
Next intCurrentRow
' Reset destination control's RowSource property.
ctldest.RowSource = ""
ctldest.RowSource = stritems
End Function