JithuAccess
Member
- Local time
- Yesterday, 23:26
- Joined
- Mar 3, 2020
- Messages
- 325
Thank you so much. I am going with your first code. It works. Thanks a lotBut the code does not fit.
You insert the separator (line break) at the end, but cut off the 1st character at the beginning.
Either remove the line break at the end, or (better readable for me) add the line break at the beginning and then remove the line break at the beginning.
orCode:With Me.TestListBox For Each SelectedItem In .ItemsSelected SelectedItemInfo = SelectedItemInfo & .Column(0, SelectedItem) & " | " & .Column(1, SelectedItem) & " | " & .Column(2, SelectedItem) & vbNewLine strFileNum = .Column(0) & strFileNum ' <-- without "|" or "," ? Next SelectedItem End With If Len(SelectedItemInfo) > 0 Then SelectedItemInfo = left(SelectedItemInfo, len(SelectedItemInfo) - len(vbNewLine)) End If
Code:With Me.TestListBox For Each SelectedItem In .ItemsSelected SelectedItemInfo = SelectedItemInfo & vbNewLine & .Column(0, SelectedItem) & " | " & .Column(1, SelectedItem) & " | " & .Column(2, SelectedItem) strFileNum = .Column(0) & strFileNum ' <-- without "|" or "," ? Next SelectedItem End With If Len(SelectedItemInfo) > 0 Then SelectedItemInfo = Mid(SelectedItemInfo, len(vbNewLine)) End If