I'm just trying to work out why you can't reproduce my problem. I'm thinking it's a bug in version 2003. Try following these steps.
1. Create query: save as qryTheTest
2. In SQL view of this query type: SELECT * FROM [some non-empty table you have] WHERE SetUserGroupCri teria()
3. Create a Function in one of your modules called SetUserGroupCri teria()
4. Populate that function with:
5. Place a breakpoint in that function to confirm it is being called, and is returning: "[Field] Like "NONEXISTENTSTR ING""
6. In qryTheTest activate datasheet view
7. I predict you will get a list of every record in the table you specified, when you should have received an empty set
1. Create query: save as qryTheTest
2. In SQL view of this query type: SELECT * FROM [some non-empty table you have] WHERE SetUserGroupCri teria()
3. Create a Function in one of your modules called SetUserGroupCri teria()
4. Populate that function with:
Code:
Public Function SetUserGroupCriteria() As String[INDENT]SetUserGroupLikeCriteria = "[some valid string field in your table] Like ""NONEXISTENTSTRING"""[/INDENT] End function
6. In qryTheTest activate datasheet view
7. I predict you will get a list of every record in the table you specified, when you should have received an empty set
Comment