Access report filter

  • Thread starter Thread starter rknight
  • Start date Start date
R

rknight

How can I get VBA to set the filter property of an Access report (as
I
would manually by going into design mode and typing the criteria into
the property window). I have used VBA in Excel some, using the record
macro feature to learn how to address objects, but I have no idea
where to start with Access. Please help.

rk
 
How can I get VBA to set the filter property of an Access report

Type Ctrl-G to open the VBA editor (and get to the VBA help file); search for
help on the OpenReport method. One of the optional arguments is the report's
filter.

John W. Vinson [MVP]
 
How can I get VBA to set the filter property of an Access report (as
I
would manually by going into design mode and typing the criteria into
the property window). I have used VBA in Excel some, using the record
macro feature to learn how to address objects, but I have no idea
where to start with Access. Please help.

rk

The next time you post a question you might try to be more specific,
as oftentimes what you specifically wish to do determines how you do
it. I suspect (by using the filter property of the report) you are
using the wrong method here.

As a starting point, look up (in VBA Help) the OpenReport method.
Take note of the 4th argument .. the Where clause.
Also look up in VBA help:
Where Clause + Restrict data to a subset of records.

Also look up Query + Create a Parameter query
 
The next time you post a question you might try to be more specific,
as oftentimes what you specifically wish to do determines how you do
it. I suspect (by using the filter property of the report) you are
using the wrong method here.

As a starting point, look up (in VBA Help) the OpenReport method.
Take note of the 4th argument .. the Where clause.
Also look up in VBA help:
Where Clause + Restrict data to a subset of records.

Also look up Query + Create a Parameter query

Sorry for not being specific enough but I'm currently not using any
method. I presently open a report manually, click the design button,
open the properties window, and in the filter box change the criteria
from Frifat=yes to Frifat=no. I know how to make VBA determine if
today is Friday or not - I just need it to change the yes to no and
the no to yes accordingly.

Thanks for the advise, I will look it up first chance I get (I do not
have Internet access and Access access at the same place - it's weird)

rk
 
Back
Top