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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print a report from data in a form

Status
Not open for further replies.

Dclegg

MIS
Aug 24, 1999
9
0
0
US
I have a form which contains data from several linked tables. The form is populated from a query based upon user supplied variable. I want to set up a command button which will permit the user to print a report which looks like the form. The reason for printing the report instead of the form is that there needs to be a page break at a certain place which can't be done with a form (as I understand it).

I seem to have it working; however, when I click the print button, the system is asking for the variable again. I have not closed the query so I think all of the data should be available for direct input into the report (based upon the same query). Once I input the variable again, it populates the report and I can print it.

Thoughts on what I'm doing wrong? Thanks.
 
This is almost the same problem that I was having on Form Value on Report. I would be able to insert the total for one form, but on the report that one total would be on every other report. You would need to put a Open report button on the form in the detail section and on the report put an unbound textbox that =Form![NameForm]![Total]. Then while the form is open click the open report button and see what happens. It will allow you to input only from that form that is opened correctly. You can also set the report button up to print instead of print preview, that way you would not even have to go to the report. I hope this help a little :).

Shirley
 
It's similar but what I'm actually doing is just bringing in data from several tables and displaying them in a form based on a case file number entered by the user on another form. There are no calculations involved. That input serves as criteria for the query which populates the form. That part works fine.

The user will then have two choices - close the form or with a print command button, print a report based on the same query.

My problem is that the user is prompted to re-enter the case file number again instead of the report just printing. As I understand it, reports are based upon table or queries, not forms. I have linked the report to the same query for both the form and the report and should only have to enter the case file number once. It just isn't working that way.

Doug
 
Have you tried saving the criteria as a declared variable on the on click event procedure of the button. Then you need to make a copy of your query without the criteria being specified and then applying the value of the variable to the report.

Umbane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top