I am attempting to get the values from a multiselect listbox (access 2003) where the listbox contains 2 columns. the viewable text (column 2) and the associated number (column 1) to use as criteria in a report. the code I am using is close but produces exclamations around my number as if it were text. I can't seem to make it recognize as numeric.
Dim varItem As Variant
For Each varItem In Me.lstCauses.ItemsSelected
stLinkCriteria = stLinkCriteria & "[LLQID] =" _
& Chr(39) & Me.lstCauses.Column(0, varItem) & Chr(39) & " Or "
Next varItem
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 4) 'Remove the last " Or "
stlinkcriteria = [LLQID] = '1'
Produces error: "Datatype mismatch in criteria expression"
How do I get stlinkcriteria to show: [LLQID] = 1 (no exclamations)?
Dim varItem As Variant
For Each varItem In Me.lstCauses.ItemsSelected
stLinkCriteria = stLinkCriteria & "[LLQID] =" _
& Chr(39) & Me.lstCauses.Column(0, varItem) & Chr(39) & " Or "
Next varItem
stLinkCriteria = Left(stLinkCriteria, Len(stLinkCriteria) - 4) 'Remove the last " Or "
stlinkcriteria = [LLQID] = '1'
Produces error: "Datatype mismatch in criteria expression"
How do I get stlinkcriteria to show: [LLQID] = 1 (no exclamations)?