D
D Burke
Hi,
I have a query in which I am pulling data based from a table based on
several choices in various listboxes.
Thus far I have found that every possible combination of possibilities
works - except those in which the choice is 'yes' or 'no' and is set to pull
data from a 'yes/no' type field in a table. I keep getting a 'Data Type
Mismatch' error where these are included.
I've included a segment of my code that refers to one of these fields
(there are several others, but are exactly the same save for the field
names).
If Forms!MailMergeExport!MutualFund.ItemsSelected.Count > 0 Then
strWhereMutualFund = "[Prospect Client Records].MF IN("
For Each varItem In Forms!MailMergeExport!MutualFund.ItemsSelected
strWhereMutualFund = strWhereMutualFund & "'" &
ctl8.ItemData(varItem) & "', "
Next varItem
'remove final comma/space and add ")"
strWhereMutualFund = Left(strWhereMutualFund, Len(strWhereMutualFund) -
2) & ")"
Else
strWhereMutualFund = "(1=1)"
End If
Does anyone have any suggestions as to how to resolve this?
Thanks in advance!!!
I have a query in which I am pulling data based from a table based on
several choices in various listboxes.
Thus far I have found that every possible combination of possibilities
works - except those in which the choice is 'yes' or 'no' and is set to pull
data from a 'yes/no' type field in a table. I keep getting a 'Data Type
Mismatch' error where these are included.
I've included a segment of my code that refers to one of these fields
(there are several others, but are exactly the same save for the field
names).
If Forms!MailMergeExport!MutualFund.ItemsSelected.Count > 0 Then
strWhereMutualFund = "[Prospect Client Records].MF IN("
For Each varItem In Forms!MailMergeExport!MutualFund.ItemsSelected
strWhereMutualFund = strWhereMutualFund & "'" &
ctl8.ItemData(varItem) & "', "
Next varItem
'remove final comma/space and add ")"
strWhereMutualFund = Left(strWhereMutualFund, Len(strWhereMutualFund) -
2) & ")"
Else
strWhereMutualFund = "(1=1)"
End If
Does anyone have any suggestions as to how to resolve this?
Thanks in advance!!!