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
vCenter Converter and SBS2008
asp.net I have a sqldatasource select witha a where that searches between dates
How to connect to network printer linux
Microsoft RDP 7 Not Working
use wireshark to capture whats happening during the logon process
Upgrade ESX 4.0U1 to 4.1
Migrate 2000 dc to 2008 dc
C# sharing variables or data between different classes
Copy and Paste using VBA based on criteria including concatenation
Php 500 internal server error received on website but not using xampp at home