G
Guest
I've built a query form that returns a string I want to apply to the main
form. Sometimes that works fine, other times I get the message "You can't
use the ApplyFilter action on this window". To try to be sure I'm on the
correct window I do a docmd.SelectObject command first, but that does not
help. My code looks like the following:
If qFilter <> "" Then
DoCmd.SelectObject acForm, "Project"
DoCmd.ApplyFilter , qFilter
End If
where qFilter is the filter string and "Project" is the name of form I want
to apply the filter to. As a work around I tried to set qFilter to the form
filter property, however, this only works if the string is not too big. I
need the 32K character length that apply filter gives me.
In as case where it works the string is:
"ProjectID IN (597)"
In a case where it did not work the string is:
"ProjectID IN (4)"
This is a hard one. Thanks for your help.
form. Sometimes that works fine, other times I get the message "You can't
use the ApplyFilter action on this window". To try to be sure I'm on the
correct window I do a docmd.SelectObject command first, but that does not
help. My code looks like the following:
If qFilter <> "" Then
DoCmd.SelectObject acForm, "Project"
DoCmd.ApplyFilter , qFilter
End If
where qFilter is the filter string and "Project" is the name of form I want
to apply the filter to. As a work around I tried to set qFilter to the form
filter property, however, this only works if the string is not too big. I
need the 32K character length that apply filter gives me.
In as case where it works the string is:
"ProjectID IN (597)"
In a case where it did not work the string is:
"ProjectID IN (4)"
This is a hard one. Thanks for your help.