Hi All,
I have a procedure that concatenates sample numbers. The format of the
numbers are B-00001, B-00002, etc.
For example, if I have 3 sample numbers and I want to concatenate them
as follows:
('B-00001', 'B-0002', 'B-00003')
I wrote the following code:
_____________________________________
Dim frm As Form, ctl As Control
Dim varItem As Variant
Dim strSampleNumbers As String
Set frm = Forms!frmBlanks
Set ctl = frm!lboBlankDetails
strSampleNumbers = "("
For Each varItem In ctl.ItemsSelected
strSampleNumbers = strSampleNumbers & "', '" & ctl.ItemData(varItem)
Next varItem
strSampleNumbers = strSampleNumbers & "')"
______________________________________
However, the output is:
(', 'B-00001', 'B-0002', 'B-00003')
Can anybody help. I want to try avoiding using a "For i=0 to Count
....Next i" type structure.
Thanks!
Peter