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

Problem printing report

Status
Not open for further replies.

medic133

Technical User
Apr 7, 2002
86
US
I have a command button on a form (form1) whose OnClick event is to launch another form (form2) for the user to enter a parameter for a query. After entering a name in a textbox on form2, clicking a command button on form2 displays a report. In the report header, I have a textbox whose value is [forms]![form2]![fieldname]. When the report is displayed, everything looks good. However, I have designed a custom toolbar with a print button on it which opens the print dialog box so the user can choose to print from any printer. When the report is printed, #Name appears in the textbox. I think my problem is when the form is printed, it looks for [forms]![form2]![fieldname] but I have already closed the form. If I'm right, or wrong for that matter, any ideas on how to get the report to print correctly, just like the screen? The reason I close form2 after the report is opened is so when the report is closed via a command button on the custom toolbar, form1 appears, which is important to have happen. Thanks in advance!!
 
Have you considered using the Report_Close event to close form2? That way it will be open while you need it, but you can close it when the report is done with it.

-Gary
 
Gary,

Thanks for the idea. I obviously hadn't thought of that. I'll give it a try!! Thanks much!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top