access database and help with printing filtered information

pwssms

New member
Local time
Today, 13:11
Joined
Mar 19, 2005
Messages
6
I need help. I have created a database and made a form. From the form page I want to filter out a portion of my 74 items and print them to a report I have already created using a button on the form. I have already created a form, report, and button. Just need help linking them all up.

I am wanting to use the filter by form button at the top. Key in filtering information in the form, then apply the filter. Then, I want to click my button on the screen and only see the filter data. I currently can click the button and all 74 items show on the report.

Any help would be appreciated.

Thanks,
Phil
 
Try this...
If you don't have an 'open report' button on your form, use the wizard to create one. (don't use a 'macro', turn on the controls wizard at the top of your controls toolbox and then add a button to your form)

Then in the properties sheet for the button, go to 'events' and see that the onClick event is loaded...click on the three dots next to it and see the code.
Where you see this...
DoCmd.OpenReport stDocName, acPreview
Put this right under it...
With Reports(stDocName)
.Filter = Me.Filter
.FilterOn = True
End With

And then your report will open to whatever you filtered your form to view.

Sarge.
 
Thanks

AWESOME!!

Thank you Sarge!! You the man!!

It works great
 
Wow, I actually helped someone instead of the usual rubbish that I throw down. Cool!

You are very welcome,
Sarge.
 

Users who are viewing this thread

Back
Top Bottom