-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
' this is a very easy solution
' probably a much more elegant one, that I can't think of
For Each varItems In Me.ListDOS.ItemsSelected
If strMods = vbNullString Then
strMods = "=" & """" & Me.ListDOS.Column(1, varItems) & """"
Else
strMods = "=" & """" & Me.ListDOS.Column(1, varItems) & """"
End If
exit for
Next varItems
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQUcyjIechKqOuFEgEQL6cQCeOLdsBH9G+0KlV0bKYm+Dxz XNHvcAoMXX
EOWcSgKVvpX4nBXh9slLg+0x
=MOof
-----END PGP SIGNATURE-----
Peter Bailey wrote:
I have a list box where the user might need to select two items which builds
up an sql string. Another part of the function only requires the first item.
here is the code :
For Each varItems In Me.ListDOS.ItemsSelected
If strMods = vbNullString Then
strMods = "=" & """" & Me.ListDOS.Column(1, varItems) & """"
Else
strMods = "=" & """" & Me.ListDOS.Column(1, varItems) & """"
End If
Next varItems
I am not sure how to amend it so that it reaches only the first item, stores
it to strMods and then drops out of the loop.