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

Hoe to close a report from a form.

Status
Not open for further replies.

kkgusta

MIS
Nov 10, 2005
42
NZ
I have created a search button using the Docmd.OpenReport code get the report I want. however if i wanted to search for a new report with different conditions and I forget to close the previous report, the docmd.openreport function will only bring the old report to the front and will not allow me to get the new report. Can someone tell me how to slove this problem ?

 
You can add a line of code like this prior to opening the report.
DoCmd.Close acReport, "rptYourReportName"
You may want to add code to ignore the error if the report is not open.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you for you answer, you have just solve my problem.
Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top