subforms and filters

inbal

Registered User.
Local time
Today, 07:54
Joined
Feb 8, 2009
Messages
48
i have a sub form that opens a list of activities.
on this subform i created a button that gives me only sertain activities by a filter.
the problem is the button opens me the subform a second time instead of refreshing the one that is opened
this is my code:

Dim strwhere As String

strwhere = "[activityclosed]![date]> #01/09/2009# And [activityclosed]![date]< #31/08/2010#"

DoCmd.OpenForm FormName:="activityclosedsubform", wherecondition:=strwhere

i think the problem is because of the DoCmd... but i dont know what to write instead.

HELP PLEASE!
thanks
 
#1, Date is a reserved word and should preverably not be used as a column name.

The syntax of openform is (or press F1 to find it in the access help)
docmd.OpenForm FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs

So in your case
DoCmd.OpenForm "activityclosedsubform", , , strwhere
 

Users who are viewing this thread

Back
Top Bottom