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

Wrong form printing!

Status
Not open for further replies.

SpandexBobcat

Technical User
Jul 31, 2003
332
GB
Hi folks,

I have been trying to print a form but with limited success... I have a continuous form (frmEngReq) based on a query (qryEng_Wk/Req) which shows jobs that have yet to be printed out, with each record having a print button. In the OnLoad event of the form I have another form opening (frmSheet), set to invisible.
What I want to happen is when one of the print buttons is pressed, frmSheet takes on the data associated with the print button and then frmSheet prints.... All is working apart from the wrong form is printing...
I have been trying to use the DoCmd.PrintOut acSelection command but it prints out frmEngReq instead. How do I set the focus to this invisible form (frmSheet) when the print button is pressed?

Thanks in advance,

SB

"If at first you don't succeed, destroy all evidence that you tried.
 
SB, I don't think you can set the focus on an invisible object but I'm curious why you can't use
DoCmd.PrintOut acSelection
and just print out frmEngReq??

Is frmSheet nicer looking or something?? If that's the case, then you might try creating a report and passing the values to the report and printing that out. You don't need to see the report to print it.
Use the DoCmd.OpenReport method and set the view argument to acNormal. That just prints the report.

Paul
 
Thanks for getting back to me Paul,

frmSheet is intended for the engineers, it has a particular format, it is printed out, filled in and it is inputted at a later date. I had thought about using a report but wondered if it were possible seeing as I had the desired form already created.
In light of what you have said I will go with the report method!

Cheers,

Simon

"If at first you don't succeed, destroy all evidence that you tried.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top