Report based on filtered form

caferacer

Registered User.
Local time
Today, 20:34
Joined
Oct 11, 2012
Messages
96
Hi All,

I want to open a report with the results from a filtered form.

I want to use a similar format to the attached Allene Browne search2000 as the base to filter the records initially, but not sure how to get the filtered results into a report and the most efficient way.

All help much appreciated.

Mark
 

Attachments

could you not just set the report's record source to be the same as the form's record source??
 
I agree with Caz, That would be the best option.
 
Hi,

Bear with me on this, reports are not my strongest point.

When you say 'same as the forms record source', which is the Client table and not filtered. Once I apply the filter in the form I want to launch a report and see only the filtered records.

I have tried to create a query with criteria to capture only the filtered records fromt he form, but the query is always blank. If I could get this to work I could base the report on the query.

If possible I was hoping I could somehow use DoCmd.OpenReport from the form and then maybe use the same filter or pass the results using open args to the report fields!!??

Apologies for my crude Access logic.

THanks
 
I think what would be best off Caferacer would be to make a parameter query which asks for the information you are searching for. (The parts you know)

Then you would then base the reports record source off of that parameter query.

In my personal database I have my report linked to my Form but it always asks for my parameter query anyway. So it would work either way, be it sourced from the query or form! :)

So all in all - Make a parameter query which filters the table and link it to both the form and report :)
 
Okay, not entirely with you, but have had an attempt.

I have created a qryDynamicSearch which I can get to launch frm the form filter button and show the records, but they are not limiting to constraints set by the forms filter, just shows all records.

There is a srtWhere string which holds the search criteria for the form which I am trying to utilise but I can't get this to work with the query. Hope that makes sense?

Thanks
 
I think you've lost me caferacer - Would you be able to post a sample of what you are trying to achieve?

What I was trying to tell you to do was utilise a Parameter Query (Google for examples) - They ask you for the criteria of your search and will bring you the records you asked for (This can be used with a forward and backward button to show multiple records on a form.

Or show everyone at once on a report :)
 
Hi,

Actually, searching for strWhere has pulled up some code which seems to work for what I want. Didn't know how to pass the filter to the report.

DoCmd.OpenReport "rptReport1", acViewPreview, , Me.Filter

Thanks for taking the time to help.

Regards

Mark
 

Users who are viewing this thread

Back
Top Bottom