Hello Maurice,
In browsing the manual "Access 2000" Developper's Handbook" written by Ken
Getz & al
there is in chapter 8 a full discussion about filtering by form.
It is obvious that normally, at least with Access 2000, it is easy to handle
the filter by form
and clear the filter, several actions are described.
But somehow, the filter should reset and respond to every new command !
Will have a go !
Tried on an old database (Access 2003) with 8 combos used for filtering
(worked very well !)
Opened with ACCESS 2007, filter by form works first time, then refuses to
update with combos changes.
In Filter Property, tried with both options: Filter On Load = True, then
False,
no success, the first filter remains (though if Filter On Load = False, then
the
SQL sequence is empty (when I check in Form Design Mode)).
if Filter On Load = True, then the SQL filter is there but in both cases,
the form is "stuck" on the first filter demand !
Tried several config setup !
=========================================================
test 1:
with Property set at Filter On Load = No
..FilterOn = True
..Filter = ""
DoCmd.ApplyFilter "myCombosFilter", ""
even after DoCmd.ShowAllRecords, no success !
(in fact this command does not eliminate the filter, just shows all the
records !)
SQL not there
=========================================================
test 2:
with Property set at Filter On Load = Yes
..FilterOn = True
..Filter = ""
DoCmd.ApplyFilter "myCombosFilter", ""
even after DoCmd.ShowAllRecords, no success !
(in fact this command does not eliminate the filter, just shows all the
records !)
SQL not there
=========================================================
test 3:
with Property set at Filter On Load = Yes
..FilterOn = False
..Filter = ""
DoCmd.ApplyFilter "myCombosFilter", ""
even after DoCmd.ShowAllRecords, no success !
(in fact this command does not eliminate the filter, just shows all the
records !)
SQL not there
=========================================================
test 4:
with Property set at Filter On Load = Yes
..FilterOn = False
..Filter = ""
DoCmd.ApplyFilter "myCombosFilter", ""
even after DoCmd.ShowAllRecords, no success !
(in fact this command does not eliminate the filter, just shows all the
records !)
SQL not there
=========================================================
test 5:
with Property set at Filter On Load = No
..FilterOn = False
..Filter = ""
SendKeys "{F5}"
DoCmd.ApplyFilter "myCombosFilter", ""
SQL not there
=========================================================
Conclusion:
adding the SendKeys "{F5}" command, the filter is OK
by setting .Filter = "" or removing this option, then the SQL is there or not
but that does not change anything in the fact that, somehow, ACCESS 2007
keeps,
somewhere, the filter memorized and refuses to reset it !!!!
========================================================
I will keep this procedure, (SendKeys), until anything better comes up !
Thank you, Maurice, for your friendly contribution
fred