Selasa, 23 Oktober 2012

[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

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
.

__,_._,___

Tidak ada komentar:

Posting Komentar