Buttons on Reports???

KristenD

Registered User.
Local time
Today, 09:46
Joined
Apr 2, 2012
Messages
394
Can you put buttons on reports to either print the report or email it?

If so, how would you go about doing this? In design view adding buttons with the wizard?

This is for a front end locked down database. The users do not have access to the entry forms only reports and query exports. I also took away the ribbon up top.

Thank you!!
 
Depends on the version of Access. In 2003 and older you can place a button on a report but this is an exercise in futility, as reports in those versions are not interactive, so the button cannot be clicked. If I remember right, a button on a report in those versions doesn't even have any Event properties, so you can't program it to do anything even if you could click it. Utterly pointless.

In 2007 and later you can place a button on a report that can be interacted with, but I'm still not sure I see the point. Reports are intended to be a static display of data that you send to a printer. Presumably, you want your reports to look nice and professional when you print them. If you place a command button on a report, then that command button is going to show up on the report when you print it. Seems to me that this would certainly detract from the appearance of the report. I suppose it may be possible to write some code to hide the button during the print process, but this seems like expending effort for no real gain. I would just create a form for the users to select the report they want, then print it (or e-mail it).
 
I am working in Access 2007. I wasn't sure how to go about doing it since they do not have the ribbon available to them.

If I have a dropdown box in the form and a button, would there have to be extra code behind it to point it to the dropdown box to figure out to print the correct report?

My Access classes start in a week and hopefully I won't have as many questions.

Thank you!!
 
If I have a dropdown box in the form and a button, would there have to be extra code behind it to point it to the dropdown box to figure out to print the correct report?

If you're talking about a drop down box that contains a list of the available report names, then the code would be very simple. Something like;

Dim strReport As String

strReport = Me!cboReportNames

DoCmd.OpenReport strReport
 
Beetle,
If you don't have a button on a report, how would somebody print that report
Dick S.
 
KristenD,
Open the attachment I have under the report tread and labeled Need better report. I have a print buttons in the header of the report and they do not print the buttons. The reason I did it this way is that the people that will be using the db will not know how to go to file and print. Maybe beetle has something better. No offense intended as I am always learning.
 
Beetle,
I apologize ahead of time. I did not mean it to sound like that. What I wanted to say is that if you have a way to print without having to file and print it would be a help to me as well as I am sure KristeneD.
Dick S.
 
If you don't have a button on a report, how would somebody print that report

From a button on a form. If a user is interacting with your database (entering data, searching for records, whatever) then they are already using a form (or at least they should be), so why not just print the report from a button on the form?

Here's a typical scenario, at least the way I design things. There is a search form where a user can select or enter some values to get a filtered set of records that they want to view. Once they enter or select all the values they want they will click a button to show the results. The resulting record set will be displayed on the screen within the form. If the results are what they were expecting, then they can click the Print button. If the results are not what they expect, then they simply refine the criteria and run it again. They are still in the form. They have not opened a report on screen, only to see unexpected results, then have to close the report to get back to the form and try the search again. Once the Print button on the form is clicked, the Report will be sent directly to the printer. Since they have already seen what is going to print, and are satisfied with it, I see no reason to open the report on screen, only to force the user to then have to click another button to actually print it. It might seem a trivial matter, but i try to eliminate mouse clicks as much as possible. If a user is viewing a report on screen, then they most likely already clicked a button on a form to get where they are, so why not just send the report to the printer on the initial click.

I have a print buttons in the header of the report and they do not print the buttons.

If that's the case then I stand corrected on that matter. I'm not up to speed on the details of interactive command buttons on reports because it's just not something I've ever considered, and, like I said before, in earlier versions it wasn't even possible to the best of my knowledge.

I apologize ahead of time. I did not mean it to sound like that.

I did not find anything wrong with any of your statements, and certainly did not take offense at anything you said, so no apology necessary.:)
 
Beetle,
So glad you were not offended. A scenario at my house when I was a kid was: Mom is this shirt dirty? Yes! Mom, you didn’t even look at it. If you have to ask it is dirty. If I have to put in “no offense intended” then the shirt was dirty. Take a look at my compress file that I have attachedto this post.l Yes it prints without the button, but am building this for 50 or 100 names in there and it will waste to much paper to print all the names and dates. I have this posted under reports looking got help on such wasted space. If you have time print one of the reports for me and to make sure the buttons do not print on another printer. I had that happen once before but it seemed that her printer was not compatible with the db I made. At least that is what she told me.
 

Attachments

Beetle,
So glad you were not offended. A scenario at my house when I was a kid was: Mom is this shirt dirty? Yes! Mom, you didn’t even look at it. If you have to ask it is dirty. If I have to put in “no offense intended” then the shirt was dirty. Take a look at my compress file that I have attached to this post. Yes it prints without the button, but am building this for 50 to 100 names in there and it will waste to much paper to print all the names and dates. I have this posted under reports looking to help on such wasted space. If you have time print one of the reports for me and to make sure the buttons do not print on another printer. I had that happen once before but it seemed that her printer was not compatible with the db I made. At least that is what she told me. Choose one of the reports with little data.
Thanks Dick S.
 

Attachments

Beetle I had one meeting in CO. Know where 2567 W Lliff Ave. is?
 
When it comes to reports, small formatting changes can go a long way. I looked at your db and was able to get one of your reports (rptAttDatesAll) down from 4 pages to 2 simply by changing the page layout to Landscape, setting the margins to .25 and decreasing the height of the text boxes just slightly.

Beetle I had one meeting in CO. Know where 2567 W Lliff Ave. is?

Yes, I'm familiar with that part of town - near the university.

On a side note, you table structure is a bit denormalized. You may want to give that some further consideration.
 
That almost sounds like was I spent last week working on. I have a button on my report that prints the report that is pulled up at the time.

http://www.baldyweb.com/wherecondition.htm

Print is the default action for this code I found out, I was actually just trying to start with opening another report.
 
Beetle,
Great, thanks for looking at my db. That is what I was hoping to do. It never occurred to me to do something simple like landscape. Were you able to print without the print button showing? Also! Denormalized! That is so something I have been struggling with for a long time. What part should be changed?
Dick S.
 
Well, you appear to be tracking ministry visits to a prison. These visits will include (among other attributes) at least one prisoner and one ministry worker. Right now you're just entering the worker name in a field in your "visitations" table (tblAllDates). You need another table for the workers. This is a many-to-many relationship. A prisoner can (over time) participate in many of these visits, and so can a ministry worker. A many-to-many relationship requires three tables. Two "parent" tables and a join table which is the "child" of both parents. The join table contains a Foreign Key field for each of it's parents (so if there are two "parent" tables then there are two FK fields in the join table). Right now you have two of the three. The prisoners table is one of the parents, and the visitations table is the join. You need the other "parent" table for the workers.

Also, it looks like the prisoners can sometimes get awards. Another m-to-m relationship, so you need a table to hold the descriptive information about the awards. As far as the join table for this relationship, that depends. If the awards are given during the visits, then the visitations table could serve as the join for this relationship as well. If there is some other method by which the awards are given, then you may need a separate join table for this.
 
Wow! that will give me a lot to study. Thanks I have just copied the db to the one of the end users computer but I have until Friday to return it, so I will pour over your advice and see if I can inprove it before I return it. I have another problem that just popped up but I am not going to post it here as I want to expose it to everyone. If your intrested it will be labeled conversion.
 
Beetle I changed the label to A 2010 win / Mac, under general, if your intrested
 

Users who are viewing this thread

Back
Top Bottom