Report, selection criteria, toggle, etc.

S

Susan

I have certain report that is dependent on a specific field being >0. I can
open the report and click the toggle filter and obtain the report that I
want. Then I save and close the report.

Is there a way to set a condition in the report so that only the field >0 is
selected and I do not have to click the toggle switch everytime I open the
report to obtain the results I want?
 
B

banem2

I have certain report that is dependent on a specific field being >0. I can
open the report and click the toggle filter and obtain the report that I
want. Then I save and close the report.

Is there a way to set a condition in the report so that only the field >0is
selected and I do not have to click the toggle switch everytime I open the
report to obtain the results I want?

There are 2 properties you can use to filter the report: Filter and
FilterOn. In filter property write "[FieldName] > 0" and set the
FilterOn to "Yes".

You could also filter the results using query instead table and set
the condition [FieldName] > 0. Add to source query all the field from
the table and writhe "> 0" in Criteria field of the field you are
filtering.

Furthemore to make it user friendly you could create a form to set
filters and open the report using the form. In this case you can use a
combo box with operands "<", "=" and ">" and run the report with
command (OnClick event of the button to open the report):

DoCmd.OpenReport "rptName", acViewPreview,,"[FieldName] " &
Me.ComboBoxName & " 0"

You could also use macro instead VBA if you are not familiar with VBA
programming, etc. There are lots of variety to filter the report, but
if you are always open the report with the same filter I will suggest
to use filtered query as record source.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
S

Susan

Thank you very much!
I have certain report that is dependent on a specific field being >0. I
can
open the report and click the toggle filter and obtain the report that I
want. Then I save and close the report.

Is there a way to set a condition in the report so that only the field >0
is
selected and I do not have to click the toggle switch everytime I open the
report to obtain the results I want?

There are 2 properties you can use to filter the report: Filter and
FilterOn. In filter property write "[FieldName] > 0" and set the
FilterOn to "Yes".

You could also filter the results using query instead table and set
the condition [FieldName] > 0. Add to source query all the field from
the table and writhe "> 0" in Criteria field of the field you are
filtering.

Furthemore to make it user friendly you could create a form to set
filters and open the report using the form. In this case you can use a
combo box with operands "<", "=" and ">" and run the report with
command (OnClick event of the button to open the report):

DoCmd.OpenReport "rptName", acViewPreview,,"[FieldName] " &
Me.ComboBoxName & " 0"

You could also use macro instead VBA if you are not familiar with VBA
programming, etc. There are lots of variety to filter the report, but
if you are always open the report with the same filter I will suggest
to use filtered query as record source.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top