What is it you are trying to do? Do you really have a need for a global variable? If you stored that field, you can assign a null to it thru a query. Melissa
Designing Access databases since 1999
If you stored it in a table rather than using a global variable, you can use a query to change a number field to null. Of course, I don't know what it is you are trying to do, so storing that variable may not even makes any sense for your purpose. My point is that you can change any field type to a null thru a query, I just don't know how to do it in code, (other than for a string type). Melissa
Designing Access databases since 1999
As mentioned by simmsey, make the global a variant and it can be set to null with code. just tried it and it works.
I can't see createing a table for a temporary variable.
The object of the exercise was to answer the question about how to get a check box to give selected records on a checked condition and all records on an unchecked condition (selecting on a true/false field)
No, in that case, if the criteria for the yes/no field is equal to the checkbox, he will get only the true records when the checkbox is checked and only the false records when the checkbox is unchecked. What he wants is the true records when the checkbox is checked and all the records when the checkbox is unchecked. The solution is a function as a variant which equals "*" if the checkbox is not checked, and -1 if the checkbox is checked. The criteria for the query is set to Like the funcion so it comes out either Like -1 or Like "*". I've tried it and it does work (By setting the Triple State property of the checkbox to True, he can make the selection of any one of the three, True records, False Records and All records.)
In the process of trying to create a solution, I attempted to set a variable to null and this prompted my question
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.