Connie-
I would have used Me.Name instead of hard-coding the report name. Are you
sure you have the report name correct? The code must be in the outer
report that has sub-reports. It cannot be in one of the sub reports.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
-----Original Message-----
From: mrsgoudge <no_reply@yahoogroups.com>
Reply-To: <MS_Access_Professionals@yahoogroups.com>
Date: Tuesday, October 23, 2012 9:50 PM
To: <MS_Access_Professionals@yahoogroups.com>
Subject: [MS_AccessPros] Close a report when deactivated
Hi all-
I am using the code below to close a report when it's deactivated. It
works. Then I put the same code (with a change to the name of the new
report) in another report. When I click on MainMenu's tab I get a message
that "this action can't be carried out while processing a form or report".
"this action" refers to DoCmd.Close ....
The report that it's working on is a main report with several subforms.
I'm guessing that's making the difference. Is there any way to make this
work?
Connie
Private Sub Report_Deactivate()
On Error GoTo Proc_Err
DoCmd.Close acReport, "rinfoSheetp2"
Proc_Exit:
Exit Sub ' or Exit Function
Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " Report_Deactivate"
Resume Proc_Exit
End Sub
------------------------------------
Yahoo! Groups Links
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar