filtered form data only

F

fishqqq

Can someone tell me how to get a report to capture only the data that
is left on the form once i've played with it a bit.

ie: the form lists all the transactions in the dbase. i right click on
the date field and select "filter by selection" so not the form only
shows me records matching the date i selected.

Then i hit the report button i created and the report (which is based
on the same query that the form is based on ) returns all the records
not just the ones left on the 'filtered' form.

is there an easy way to send the newly filtered data to the form
instead of all the data?

tks
 
M

Marshall Barton

Can someone tell me how to get a report to capture only the data that
is left on the form once i've played with it a bit.

ie: the form lists all the transactions in the dbase. i right click on
the date field and select "filter by selection" so not the form only
shows me records matching the date i selected.

Then i hit the report button i created and the report (which is based
on the same query that the form is based on ) returns all the records
not just the ones left on the 'filtered' form.

is there an easy way to send the newly filtered data to the form
instead of all the data?


Try changing the button's OpenReport line so it uses the
form's Filter if it is used by the form:

If Me.FilterOn And Len(Me.Filter) > 0 Then
stCriteria = Me.Filter
Else
stCriteria = "" ' filter not being used
End If
DoCmd.OpenReport "report name", acViewPreview, , stCriteria
 
F

fishqqq

Try changing the button's OpenReport line so it uses the
form's Filter if it is used by the form:

If Me.FilterOn And Len(Me.Filter) > 0 Then
        stCriteria = Me.Filter
Else
        stCriteria = ""               ' filter not being used
End If
DoCmd.OpenReport "report name", acViewPreview, , stCriteria

Thanks Marsh.
right now i have the reports saved as "OPS DASHBOARD CARD"
And a button on the form ([fGODMAIN2]) which i set the "on click"
feature to open the OPS DASHBOARD CARD
form.

I trigger this event with a "open report" action in a macro -
[Shipment tracking]![Print Ops Dashboard]
Is there a way i can set this report to only show the forms 'filtered'
results? Note these results will change every time the user filters
the specific data they want to see before printing the report . (this
makes the report more flexible then having the same fields filtered
every time it is printed)


tks
Steve
 
M

Marshall Barton

Try changing the button's OpenReport line so it uses the
form's Filter if it is used by the form:

If Me.FilterOn And Len(Me.Filter) > 0 Then
        stCriteria = Me.Filter
Else
        stCriteria = ""               ' filter not being used
End If
DoCmd.OpenReport "report name", acViewPreview, , stCriteria

right now i have the reports saved as "OPS DASHBOARD CARD"
And a button on the form ([fGODMAIN2]) which i set the "on click"
feature to open the OPS DASHBOARD CARD
form.

I trigger this event with a "open report" action in a macro -
[Shipment tracking]![Print Ops Dashboard]
Is there a way i can set this report to only show the forms 'filtered'
results? Note these results will change every time the user filters
the specific data they want to see before printing the report . (this
makes the report more flexible then having the same fields filtered
every time it is printed)

Just set the macro's WhereCondition argument to the form's
filter property. I don't use macros because they are too
limited, clumsy and impossible to maintain over time, so I
don't know the specifics about referring to a form property
in macro, probably something like [Forms]![MyForm].[Filter].
But then you will use the filter even if you turn the
filtering off.
 
F

fishqqq

right now i have the reports saved as "OPS DASHBOARD CARD"
And a button on the form ([fGODMAIN2]) which i set the "on click"
feature to open the OPS DASHBOARD CARD
form.
I trigger this event with a "open report" action in a macro -
[Shipment tracking]![Print Ops Dashboard]
Is there a way i can set this report to only show the forms 'filtered'
results? Note these results will change every time the user filters
the specific data they want to see before printing the report . (this
makes the report more flexible then having the same fields filtered
every time it is printed)

Just set the macro's WhereCondition argument to the form's
filter property.  I don't use macros because they are too
limited, clumsy and impossible to maintain over time, so I
don't know the specifics about  referring to a form property
in macro, probably something like [Forms]![MyForm].[Filter].
But then you will use the filter even if you turn the
filtering off.

hI Marsh,
I worked out a great way to do this by pasting the form data into a
table then opening the report that is based on that table.
It works perfectly except when the macro pastes the data into the form
a message screen comes on asking the user if they want to paste this
data into the form etc. is there a way to disable these message
screens so the macro can perform the cut/paste on it's own without any
user feedback?
 
M

Marshall Barton

On Jun 19, 10:26 am, Marshall Barton wrote:
(e-mail address removed) wrote:
Can someone tell me how to get a report to capture only the data that
is left on the form once i've played with it a bit.
ie: the form lists all the transactions in the dbase. i right click on
the date field and select "filter by selection" so not the form only
shows me records matching the date i selected.
Then i hit the report button i created and the report (which is based
on the same query that the form is based on ) returns all the records
not just the ones left on the 'filtered' form.
is there an easy way to send the newly filtered data to the form
instead of all the data?
Try changing the button's OpenReport line so it uses the
form's Filter if it is used by the form:
If Me.FilterOn And Len(Me.Filter) > 0 Then
        stCriteria = Me.Filter
Else
        stCriteria = ""               ' filter not being used
End If
DoCmd.OpenReport "report name", acViewPreview, , stCriteria
right now i have the reports saved as "OPS DASHBOARD CARD"
And a button on the form ([fGODMAIN2]) which i set the "on click"
feature to open the OPS DASHBOARD CARD
form.
I trigger this event with a "open report" action in a macro -
[Shipment tracking]![Print Ops Dashboard]
Is there a way i can set this report to only show the forms 'filtered'
results? Note these results will change every time the user filters
the specific data they want to see before printing the report . (this
makes the report more flexible then having the same fields filtered
every time it is printed)

Just set the macro's WhereCondition argument to the form's
filter property.  I don't use macros because they are too
limited, clumsy and impossible to maintain over time, so I
don't know the specifics about  referring to a form property
in macro, probably something like [Forms]![MyForm].[Filter].
But then you will use the filter even if you turn the
filtering off.

I worked out a great way to do this by pasting the form data into a
table then opening the report that is based on that table.
It works perfectly except when the macro pastes the data into the form
a message screen comes on asking the user if they want to paste this
data into the form etc. is there a way to disable these message
screens so the macro can perform the cut/paste on it's own without any
user feedback?


That sounds more than a little clumsy, but if you're happy,
what can I say.

This scenario you've come up with and in the way you're
doing it is completely uncharted territory for me so I can
only nake a stab in the dark. Try using Set Warnings, just
make sure you turn warnings back on in the same macro.
 

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