How are we all today, Good I hope. Here is what I am working with, ,I have a listbox, that uses a query to get said data, it is a multi select listbox. when I select the data it puts them in a textbox below. So as I can use it in a report.There ar 4 column is the list box, here is the problem, I need a total of 4 text boxes, one for each column here is a ex col1,col2,col3,col4 listbox
text1 text2 text3 text4 textboxes
col1 col2 col3 col4
here is the code I am useing, I can only get the data in one textbox with this:
Private Sub contractdata_GotFocus()
Me![Date].ControlSource = "=ShowContractDataSelected()"
End Sub
Public Function ShowContractDataSelected()
Dim condata As Variant
Dim fillit As String
For Each condata In Me![contractdata].ItemsSelected()
'If it is not the first item
If Len(fillit) <> 0 Then fillit = fillit & Chr(13) & Chr(10)
fillit = fillit & Me![contractdata].Column(0, condata)
Next condata
ShowContractDataSelected = fillit
End Function
is there a way to do this with muliple text boxes.
Any help would sure put this head ache at rest
thanks
zypha
text1 text2 text3 text4 textboxes
col1 col2 col3 col4
here is the code I am useing, I can only get the data in one textbox with this:
Private Sub contractdata_GotFocus()
Me![Date].ControlSource = "=ShowContractDataSelected()"
End Sub
Public Function ShowContractDataSelected()
Dim condata As Variant
Dim fillit As String
For Each condata In Me![contractdata].ItemsSelected()
'If it is not the first item
If Len(fillit) <> 0 Then fillit = fillit & Chr(13) & Chr(10)
fillit = fillit & Me![contractdata].Column(0, condata)
Next condata
ShowContractDataSelected = fillit
End Function
is there a way to do this with muliple text boxes.
Any help would sure put this head ache at rest
thanks
zypha