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

Closing a report from a form 1

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
IE
Hi all,
I am having problems printing and need to shut down my report properly before I print the next one.
How do I do this? It is the last line I am having trouble with.

objAccess.DoCmd.OpenReport "Labels", acViewDesign
objAccess.Reports(0).RecordSource = sSQL
objAccess.DoCmd.OpenReport "Labels", acViewNormal
objAccess.Reports(0).??????????

Any help gratefully received,
Thanks,
Robin
 
Place the code to set the recordsource within the
onopen event of your report rather than the calling
form, so that you never open it in preview.

that way the form just calls docmd.open in
acnormal, and you have nothing to close.

If you have trouble referencing the string
you intend to use for the recordsource,
i reccommend placing it in an invisible
textbox on the form.

-g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top