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 get the F6 storage drivers to work on a 8100 Elite Convertable Mini Tower?
Import vs. link
how can i get a list of client inbox rules through powershell
Dot Net IL Code to C# conversion
export the sas dataset to create a table in my sql database
Access VBA set all values of a Yes/No field to no
IE8 annoying advertising popups on double underlined links in webpages
Navigation mouse over problem
Oracle Fusion Middleware Vs IBM WAS
Access 2007 Update subform values with another subform