A
Alastair MacFarlane
Dear All,
I am trying to use the function "MyAgencyContact" below in the criteria of a
query, such as Agency = the string return value of the function. The return
value in this example is - Like '[A-D]*', which works when I directly type
the string into the criteria box of the query, but it does not work with the
return value of the function. I would imagine that it is something to do
with the word 'Like'. Can someone please enlighten me?
Thanks again...
Alastair MacFarlane
----Code----
Public strLeftLetter As String * 1
Public strRightLetter As String * 1
Public Function MyAgencyContact() As String
strLeftLetter = "A"
strRightLetter = "D"
MyAgencyContact = "Like '[" & strLeftLetter & "-" & strRightLetter & "]*'"
End Function
I am trying to use the function "MyAgencyContact" below in the criteria of a
query, such as Agency = the string return value of the function. The return
value in this example is - Like '[A-D]*', which works when I directly type
the string into the criteria box of the query, but it does not work with the
return value of the function. I would imagine that it is something to do
with the word 'Like'. Can someone please enlighten me?
Thanks again...
Alastair MacFarlane
----Code----
Public strLeftLetter As String * 1
Public strRightLetter As String * 1
Public Function MyAgencyContact() As String
strLeftLetter = "A"
strRightLetter = "D"
MyAgencyContact = "Like '[" & strLeftLetter & "-" & strRightLetter & "]*'"
End Function