C
Charles D Clayton Jr
A2K
I have a main form that uses a tab sheet to change the subforms. The
last subform is based on a crosstab query. I put some filter buttons
on the form (A-Z, Z-A, By Selection, Exclude Selection, Remove
Filter). Everything works fine until I remove filter. When I do
that, it then will not allow me to Filter by Selection of Exclude
Selection. It says "Cannot use the crosstab of a non- fixed column as
a sub-query"
I am not sure what the best why to "Remove filter" is. What I do is
this (code snipet):
db.QueryDefs.Delete "qFindSpools"
Set Q = db.CreateQueryDef("qFindSpools", strSQL)
Forms!MainForm_Spools![TabsubfrmSpools].Form.RecordSource = strSQL
Forms!MainForm_Spools![TabsubfrmSpools].Requery
I delete a query and then recreate it for this form. My strSQL is
exactly the SQL for my subform. I just took it and pasted into the
code. But for some reason it is not working for this subform.
If I go to another sheet on the main form and then back to this
subform, the Filter by selection and exclude selection will work. But
whenever I press "remove filter" then it does not work and gives me
that error. So my problem is in the code for remove filter. I know
that my 'strSQL' string is correct because I take that straight from
the subform's recordsource.
Does anybody have any suggestions on what my problem is? Or a better
way to remove filters?
Thanks,
Charles D Clayton Jr
I have a main form that uses a tab sheet to change the subforms. The
last subform is based on a crosstab query. I put some filter buttons
on the form (A-Z, Z-A, By Selection, Exclude Selection, Remove
Filter). Everything works fine until I remove filter. When I do
that, it then will not allow me to Filter by Selection of Exclude
Selection. It says "Cannot use the crosstab of a non- fixed column as
a sub-query"
I am not sure what the best why to "Remove filter" is. What I do is
this (code snipet):
db.QueryDefs.Delete "qFindSpools"
Set Q = db.CreateQueryDef("qFindSpools", strSQL)
Forms!MainForm_Spools![TabsubfrmSpools].Form.RecordSource = strSQL
Forms!MainForm_Spools![TabsubfrmSpools].Requery
I delete a query and then recreate it for this form. My strSQL is
exactly the SQL for my subform. I just took it and pasted into the
code. But for some reason it is not working for this subform.
If I go to another sheet on the main form and then back to this
subform, the Filter by selection and exclude selection will work. But
whenever I press "remove filter" then it does not work and gives me
that error. So my problem is in the code for remove filter. I know
that my 'strSQL' string is correct because I take that straight from
the subform's recordsource.
Does anybody have any suggestions on what my problem is? Or a better
way to remove filters?
Thanks,
Charles D Clayton Jr