Any thoughts would be appreciated.
The criteria I'm using in the query comes from a function: 'getJobGroup()'
Specifically, the criteria in the query reads: Like getJobGroup()
The function is:
Function getJobGroup()
Dim v
v = Forms![frm: cfax_main]!txtJobGroupCriteria
Select Case v
Case 1
getJobGroup = Chr(34) & Chr(42) & "0" & Chr(34) & Chr(32) & "Or Like" & Chr(32) & Chr(34) & Chr(42) & "9" & Chr(34)
Case 2
getJobGroup = "*1 or like *2"
Case 3
getJobGroup = "*P"
End Select
'MsgBox (getJobGroup)
End Function
Case 3 works fine, but the moment I try to add another wildcard (case 2 or case 1) to the string, the query returns 0 records.
I've also tried:
- spelling out the string using ascii in case 1
- not using the text "or" or "or Like" in between wildcards (i.e. "*1 *2")
Thanks in advance for providing any input.
The result is the same if I change the criteria to read directly from the form (i.e. "Like Forms![frm: cfax_main]!txtJobGroupCriteria") and put the branching logic in the form accordingly.
Noel
The criteria I'm using in the query comes from a function: 'getJobGroup()'
Specifically, the criteria in the query reads: Like getJobGroup()
The function is:
Function getJobGroup()
Dim v
v = Forms![frm: cfax_main]!txtJobGroupCriteria
Select Case v
Case 1
getJobGroup = Chr(34) & Chr(42) & "0" & Chr(34) & Chr(32) & "Or Like" & Chr(32) & Chr(34) & Chr(42) & "9" & Chr(34)
Case 2
getJobGroup = "*1 or like *2"
Case 3
getJobGroup = "*P"
End Select
'MsgBox (getJobGroup)
End Function
Case 3 works fine, but the moment I try to add another wildcard (case 2 or case 1) to the string, the query returns 0 records.
I've also tried:
- spelling out the string using ascii in case 1
- not using the text "or" or "or Like" in between wildcards (i.e. "*1 *2")
Thanks in advance for providing any input.
The result is the same if I change the criteria to read directly from the form (i.e. "Like Forms![frm: cfax_main]!txtJobGroupCriteria") and put the branching logic in the form accordingly.
Noel