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 to round numbers
HP Laptop w/ Vista freezing regularly
NTLDR is Missing on HP Proliant ML350 G4 with Windows 2003 SP2
program returns false missing files after find the files
Nested Gridviews RowDataBound Event Problem
Javascript to toggle DIVs and scroll to anchor link IF there is an anchor link in URL
Setting Reporting Services data driven subscription Using Web Service
Should you dismount exchange database before exhange updates?
Two computers conected by ethernet to same router
asp.net mssql I have a need to update records where the record column needs modifing in orde to match the Id value