Hi Everyone,
I'm using the code to get a variable that can be used in the criteria of a query. My problem is how its evaluated in the query i.e. I'm trying to build a criteria expression like ' "MCR" or "HL" ' but the query is seeing it as ' "MCR OR HL" ' . Is there some way to pull the "OR" out of the string? Thanks in advance for any help.
GPM
Public Function GetSite() As Variant
Module1.strSite = ""
If Module1.blnManchester = True Then Module1.strSite = Module1.strSite & "MCR or "
If Module1.blnLivingston = True Then Module1.strSite = Module1.strSite & "LIV or "
If Module1.blnHarlow = True Then Module1.strSite = Module1.strSite & "HL or "
If Len(Module1.strSite) > 0 Then Module1.strSite = Left(Module1.strSite, Len(Module1.strSite) - 4)
GetSite = Module1.strSite
End Function
I'm using the code to get a variable that can be used in the criteria of a query. My problem is how its evaluated in the query i.e. I'm trying to build a criteria expression like ' "MCR" or "HL" ' but the query is seeing it as ' "MCR OR HL" ' . Is there some way to pull the "OR" out of the string? Thanks in advance for any help.
GPM
Public Function GetSite() As Variant
Module1.strSite = ""
If Module1.blnManchester = True Then Module1.strSite = Module1.strSite & "MCR or "
If Module1.blnLivingston = True Then Module1.strSite = Module1.strSite & "LIV or "
If Module1.blnHarlow = True Then Module1.strSite = Module1.strSite & "HL or "
If Len(Module1.strSite) > 0 Then Module1.strSite = Left(Module1.strSite, Len(Module1.strSite) - 4)
GetSite = Module1.strSite
End Function