S
Steve H
I have a query that reads parameters from a form. The form contains several
unbound controls and two buttons: one to run the query, and the other to set
the value of all of the controls to Null. I've debugged the "Clear values"
button, and all of the controls (text and combo boxes) have a value of null
once it has run.
The query parameters include this code:
Like "*" & [forms]![frmSelector]![sc1] & "*"
If I run the query with no parameters entered in the form (there are others
that read dates, for example), the query returns 350 records - as it should.
If I enter a letter in the sc1 text box, the query returns 54 records - as
it should.
Here's my problem: if I then clear the form so that sc1 is Null - I've added
a control that says that IsNull([Sc1]) is True - and, therefore, the query
runs without any parameters, I only retrieve 54 records. Indeed, if I rename
- or delete - the field from the form, I still only get 54 records... the
query seems to retain its earlier results, and only clears them if I delete
the parameter from the query and run it again.
I'd be interested to know why it happens! A cure would be good.
unbound controls and two buttons: one to run the query, and the other to set
the value of all of the controls to Null. I've debugged the "Clear values"
button, and all of the controls (text and combo boxes) have a value of null
once it has run.
The query parameters include this code:
Like "*" & [forms]![frmSelector]![sc1] & "*"
If I run the query with no parameters entered in the form (there are others
that read dates, for example), the query returns 350 records - as it should.
If I enter a letter in the sc1 text box, the query returns 54 records - as
it should.
Here's my problem: if I then clear the form so that sc1 is Null - I've added
a control that says that IsNull([Sc1]) is True - and, therefore, the query
runs without any parameters, I only retrieve 54 records. Indeed, if I rename
- or delete - the field from the form, I still only get 54 records... the
query seems to retain its earlier results, and only clears them if I delete
the parameter from the query and run it again.
I'd be interested to know why it happens! A cure would be good.