docmd.openform and WhereClause? 
Author Message
 docmd.openform and WhereClause?
I wish to open a form and filter the contents, I am used to using the
openform method of the docmd object with the whereclause parameter in access
and have tried to use this in an ADP. There seems to be a problem with ADPs
whereby sometimes it fails to filter the form properly and filters the form
using the value of the previous time the form was opened. Does anybody know
if there is a fix / workaround for this problem?

Thank you



Sat, 08 Oct 2005 23:32:30 GMT
 docmd.openform and WhereClause?

Hi Charlie,

I suppose that depends on the last filter which is
stored in the property "ServerFilter" of the form.

Try to open the form as follows

Dim frm As Form

DoCmd.OpenForm "MyForm"

Set frm = Forms("MyForm")
With frm
    .ServerFilter = WhereCondition
    .Requery
End With

Set frm = Nothing

HTH ;-)

--
Gru?, Uwe Ricken
MCP FOR MS ACCESS DEVELOPMENT
GNS GmbH, Frankfurt am Main
http://www.gns-online.de
http://www.memberadmin.com
http://www.conferenceadmin.com
____________________________________________________
APP:   http://www.AccessProfiPool.de
       http://www.dbdev.org
FAQ:   http://www.donkarl.com/AccessFAQ.htm



Sun, 09 Oct 2005 02:55:33 GMT
 docmd.openform and WhereClause?
CG> There seems to be a problem with ADPs
CG> whereby sometimes it fails to filter the
CG> form properly and filters the form
CG> using the value of the previous time the
CG> form was opened.

if you open the form with docmd with criteria, and then save the form, it's saved
with your criteria as serverfilter. Remember to reopen it then in design mode, clear
the serverfilter, and re-save.

Vadim



Mon, 10 Oct 2005 13:38:52 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. DoCmd.ApplyFilter error on third argument (FilterType)

2. DoCmd.OutputTo acStoredProcedure BUG?

3. DoCmd.SendObject to send email from ADP

4. DoCmd.TransferSpreadsheet CRASHES Access XP ADP


 
Powered by phpBB® Forum Software