I’m using a function to set criteria in a an query.
It reads the selected values from a combobox on a form and passes the appropriate value into the sql criteria
Eg; the sql criteria is set to:
like fnCountry()
and the function fnCountry() is something like;
If SelectedCountry = "All" Then
fnCountry = "*"
else fnCountry = SelectedCountry
end if
this works fine for a single selection (SelectedCountry = Africa) but doesn’t
work if I try to combine multiple selections into the criteria string.
eg; SelectedCountry = Africa Or Italy
so the criteria would need to be
Like “Africa” Or like “Italy”
how else can i build this criteria with multiple values?
It reads the selected values from a combobox on a form and passes the appropriate value into the sql criteria
Eg; the sql criteria is set to:
like fnCountry()
and the function fnCountry() is something like;
If SelectedCountry = "All" Then
fnCountry = "*"
else fnCountry = SelectedCountry
end if
this works fine for a single selection (SelectedCountry = Africa) but doesn’t
work if I try to combine multiple selections into the criteria string.
eg; SelectedCountry = Africa Or Italy
so the criteria would need to be
Like “Africa” Or like “Italy”
how else can i build this criteria with multiple values?