Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB how do I get rid of the ending ","

Status
Not open for further replies.

Tiggertoo

MIS
May 28, 2003
66
0
0
US
No I really don't speak VB of whatever this is... I stole it and customized to my needs...

Private Function PlatformSelected()
Dim Platform As Variant
Dim strItems As String
For Each Platform In Me![lstPlatform].ItemsSelected()
If Len(strItems) <> 0 Then strItems = strItems
strItems = strItems & Me![lstPlatform].Column(0, Platform) + ", " & Me![lstPlatform].Column(1, Platform)
Next Platform
PlatformSelected = strItems

End Function

I tried changing the & to + in this but I still get the ending ",
 
Hi -

Assuming the rest of the code performs as advertised, you can try this as the last line:
Code:
 PlatformSelected = Left(strItems, len(trim(strItems))-1)

HTH - Bob
 
That worked perfectly. Thank you!

I couldn't create the Access dbs that I do without Tek-tips!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top