
Originally Posted by
NTC
these 2 tests seem contradictory:
*When leaving the form open and placing: [forms]![form1]![text0] in the criteria field (where the function formerly was) and hitting enter, again, the query opens, but I get no results.
*copied the contents of text0* directly into the query criteria field. I then got data!
while these 2 tests are consistent:
* and when running the query, with in ('02','04') manually typed into the criteria field, I got the records
* copied the contents of text0* directly into the query criteria field. I then got data!
what's clear is you can't call the function as a criteria. why? not sure - never had that requirement before. as a work-around & another test you might change your form1.text0 control . right now you have it sourced on the function and it doesn't work. change that to be unbound. In the form's CurrentEvent - have the function value put into the unbound control. the query will then probably work based on your experiments is my guess.
now at least you know the function works, the query works, and it is distilled down to whether or not a query can call a function value....seems like we have the answer as 'no'. but that it is able to call it as a field appears contradictory. possibly putting that query into sql view will display a syntax error and could be manually tweaked - perhaps quotation marks...typing outloud. an interesting case.