Is there a way to have print/save options for filtered form without utilizing right click? (3 Viewers)

stormwaterguru

New member
Local time
Yesterday, 23:35
Joined
Mar 6, 2025
Messages
11
From what I have gathered, I can't simply bypass by putting a command button with macro to export a report AND have criteria (from a Form). It will export all report records...I believe. I was having a hard time wording the concept I am looking for- my apologies if it's still not clear.

How it works now is you are viewing a Project (form) and you can use a command button to view the Report (project specific permit) in Print Preview. The only option I see to save as or print is right click. My toolbar doesn't show the print options like I've seen in videos. Is there any other method to do this? Even a separate floating form that has print or save buttons? Anything? I don't feel like it's intuitive to outside users.

I thought I was being clever by creating a blank form that merely retained the ProjectID and had the Report (permit) in the detail section of the form, linked by PK & FK. Added two buttons there to download and print, but I couldn't figure out if there was a way to print Report being currently viewed on the Form. I am assuming I was attempting to create a poor or non-functional workaround. Thought I'd try at least!
 
You use the form data as criteria for the OpenReport command in the Where clause.
 
You use the form data as criteria for the OpenReport command in the Where clause.
That's my current process unless I am misunderstanding! It opens to needed report, but I was hoping to bypass opening report to "print preview" to then downloading/printing. I am hoping to download or print with a single button click of the correct filtered form.
 
Maybe I'm missing something, but DoCmd.OpenReport ..., acViewNormal can print to the default printer right away.
And DoCmd.OutputTo can "download" (we say: export) the report.
 
I don’t like to guess what the problem is without seeing what code you are actually using
 
I don’t use macros due to their limitations so I’ll drop off this thread
 
From what I have gathered, I can't simply bypass by putting a command button with macro to export a report AND have criteria (from a Form). It will export all report records...
That is not the way the OpenReport method works. There are several ways to limit the output of a report to what is showing on the form. The simplest method is to use the Where argument of the OpenReport method. Intellisense should help you or just read the help entry.

If you need more than a simple YourPK = Forms!YourFormPK, then let us know but you'll need to explain what you want to filter on.
 
In your first post you state you want to "Export a report". Does this mean you are trying to send it to the default printer? Send it to a PDF file? Export to a csv type file?

If you can be clear on exactly how you want to "export" that will help.
 
@stormwaterguru you need to paste a picture of the contents of your macro. OR, you can look at the options and find the one that lets you specify a where argument. Try reading the documentation when all else fails. The option for a where clause is there for you to find.
 

Users who are viewing this thread

Back
Top Bottom