I have a function "fProgram" attached to a global string variable (gblProgram) that I'm using as criteria in a query field ([Program]). This works fine when the variable is an exact match but what I'd like to be able to do is also show all records. If I try setting gblProgram as Null via VBA the code produces an "invalid use of Null" error.
So instead I'm using the code to pass an asterisk and attempting to build the criteria on query side using the like operator. I've tried many variations of single quotes, double quotes and chr(34) to try and get a working "Like fProgram()" aka (Like "*") string but without any luck.
(Access treats the function different than it would a field name in that some syntax that would work with a field fail with the function.)
Does anyone know the magic phrase to get this to work?
So instead I'm using the code to pass an asterisk and attempting to build the criteria on query side using the like operator. I've tried many variations of single quotes, double quotes and chr(34) to try and get a working "Like fProgram()" aka (Like "*") string but without any luck.
(Access treats the function different than it would a field name in that some syntax that would work with a field fail with the function.)
Does anyone know the magic phrase to get this to work?