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!

Access VBA -Closing a Report from Form

Status
Not open for further replies.

calihiker

Technical User
Jun 13, 2003
96
US
When I press the cancel button (which is suppose to close the form AND the report...) on a form used to supply parameter values for a report, I still get prompted (from the report) for the values of the field parameters in the form??? Meaning the report is still running...?? Can anyone tell me what is wrong? Why doesn't my docmd.close acreport... statement not work?

Private Sub cmdCancel_Click()

DoCmd.Close acForm, "frmParameters", acSaveNo
DoCmd.Close acReport, "Report_2002GiftsAllDrops_CircPlan"

End Sub

Any help would be greatly appreciated
 
Hi,

Does the cancel button close the current form (ie this is in the frmParameters form)?
If so, turn the statements around, because if the form closes with the first line, the second line of code won't be run.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top