Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access project serverfilter property problem

Status
Not open for further replies.

emuti

MIS
Apr 18, 2001
37
0
0
US
I found the following excerpt in another forum posted by somenoe named Miguel. Thought it best described the situation I was having as well. No one has replied as yet, and was wondering if anyne can help me out with this problem:

"I use DoCmd.OpenForm to open a form from another form. To select only the
records tha the user wants to see, I use the WhereCondition property of
the OpenForm. The problem occurs when the user sorts the selected records
using the bottons that Access 2000 has in the tool bar. Then, the criteria
that was specified as WhereCondition is written to the form's ServerFilter
and the criteria in the next DoCmd.OpenForm's WhereCondition is IGNORED.

That is: when there is some criteria in the ServerFilter property of the
form, the criteria you specified in the OpenForm's WhereCondition is not
used by access 2000 and the form opens using the ServerFilter instead.

Of course I know that is normal for Access 2000 to save the criteria in
the ServerFilter property. Wich is incorrect is that the ServerFilter is
applied when the form is open and, even more, instead of the
WhereCondition of the DoCmd.OpenForm.

This problem does not occurs when you use Jet (ie: mdb databases) instead
of Sql Server (project databases). "

Thanks in advance.
 
The only solution I was able to succesfuly implement was to open the form and then set the recordsource with a sql statement.

HTH

PsychPt@Hotmail.com
 
Thanks for your response.

I looked on MS's web site, and foudn the following statement:
"You can only remove a server filter by using Visual Basic to set the ServerFilterByForm property to False or clear all filter criteria in the Server Filter By Form window and then click Apply Server Filter."

So I put the the following lines in the OnClose event of the form:

Me.ServerFilter = ""
Me.ServerFilterByForm = False
DoCmd.RunCommand acCmdApplyFilterSort

So far, it works, but let's see if it will continue to work.
 
The MS solution worked, however, I had other code running in the background, which got messed up. So it's back to te drawing board.

I did set the recordsource with a sql statement, however, looks like the sql statement gets stuck. That is the form is use for various functions, so there are various sql statements based on a filter, however, it appears that the form's recordsource gets frozen with the last sql statement, even if I try to chenge the recordsource in the OnClose event.

ANy ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top