Microsoft
Software
Hardware
Network
Question : Access Multiselect Listbox code
I'm developing a string (StrHeading) of the selected listbox items within the following For loop. I want to put a comma between the item names, but not at the end of the string. (ie. if the choices are Red, Green and Blue, StrHeading will be "Red,Green,Blue".) What do I use for the # of items selected in the code below?
For Each varItem In ctl.ItemsSelected
StrHeading = StrHeading & ctl.ItemData(varItem)
If varItem <
# of items selected
StrHeading = StrHeading & ","
End If
StrInsert = ".......;"
DoCmd.RunSQL StrInsert
Next varItem
Answer : Access Multiselect Listbox code
The simplest way is to just parse the string after you fill it:
If Right(StrHeading, 1) = "," Then StrHeading = Right(StrHeading, Len(StrHeading) - 1)
Random Solutions
How do I connect to a Windows VPN server through a Cisco ASA 5505?
lpr print server issue
Cannot connect to Watchguard Firebox X15 Edge after factory reset
MS SQL Stored Procedure miscounting number of characters
Domain rename prior to consolidation
My Computer prints Very Tiny on Fresh Install
Windows 2008 - HP LaserJet 2600n drivers aren't working
XP runs slow error 0XC000005e,The Security System detected an attempted downgrade attack for server
E72 - Opear Mobile 10 crashes after loading more than one page
I am new to webservices, please help.