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
 
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
 
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?
 

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