Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I click one button and print 3 different reports? 1

Status
Not open for further replies.

traycee

IS-IT--Management
Sep 6, 2001
245
US
Currently I have a report menu the user clicks to print report page 1. When they click 'print page one' an input form appears, they put in the dates and that page prints out. Then they do the same with page 2 and again with page 3. These reports contain only totals so they contain data only in the report header, page header, and report footer areas. What I'd like to do if possible, is just have one button they click that says 'print report.' They input the date ranges and all 3 report pages print. Can a macro do this...or some other tecnique? Anybody have any ideas?
Thanks
 
Are the reports dates used in a paramater query? Do all three reports require the same dates?

If so, then add the date ranges to controls on a form, have the user enter the dates, and make your buttom macro launch the reports one at a time.

I can help if you need more info on how to do this. And if I am not understanding what you are asking, I appologize.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Thanks for the reply. Yes, the report dates are used in a parameter query. Two of the reports require the same dates (the beginning and ending dates for a fiscal quarter) the 3rd page requires the beginning date of the first quarter and then just the end dates for each quarter in the year so that the report can show a comparison count side by side for each quarter. Right now each has its own input form. Can I combine them so that all input fields are on a single form, the user inputs the data, and then the macro attached to the report button is set to open each report one after the other?
 
Yes, the Macro can open multiple reports. Did you use the button wizard to set up your macro? If so, if you look at the macro, you will see it is really fairly simple. Has a command openreport, with the report name as a paramater.

Also, the reports are based on a query, and the query has fields with [enter start date] or what not as criteria. If you make on a form an unbound text box, set the format as date, and call it say "From", and the form is called Myform, then you can replace in your query the [enter dates] with forms!MyForm.From to get your paramaters.

Hope that helps.

ChaZ

Ascii dumb question, get a dumb Ansi
 
The form is remade and all the parameters have been redone to get input from that form. I think i messed up the macro for the OK button. It's giving me an error message. What I did was create a macro called OKButton and then listed OpenReport 3 times in that macro - once for each report I need to print and then tied it in to the onclick event for the OK button. As you can tell, I'm fairly new at this. What should I have done?
 
Sounds like you did what you should have.

What is the error message?

ChaZ

Ascii dumb question, get a dumb Ansi
 
I think I'm closer. I input data into the form. The first page of the report prints. A small box pops up saying it is printing page 2, but it is waiting until I enter the data back into the same form before it prints it. So....it looks like I am managing to call up the next page, but the next pages are not automatically taking the data from the input form and running automatically.
 
The query the reports are based on all need to point to the text boxes on the form for the paramaters. Not just the first.

I am gussing that is the problem, but I don't have enough information.

ChaZ

Ascii dumb question, get a dumb Ansi
 
I want to thank you. If you hadn't answered I may not even have tried to get all 3 pages to run after inputting data into a single form, but I've got it. After taking your advice about the queries and the button, I was part way there. The problem was that each of the forms onopen and onclose events...I referenced the open and close of my macro. That is why it was calling for me to fill in the form each time. Once I removed those references, it flows beautifully. It will be soooo much simpler for the users this way. I can't tell you how much I appreciate your help.
Thanks.
 
No problem. Glad to help.

ChaZ

Ascii dumb question, get a dumb Ansi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top