-
help with on click event
Hello
I have a report, I opened in designview. When I click close report
The mainform will appear. In that mainform there is command button with a click event.
Code:
Private Sub lblFilterUit_Click()
Now I wanted to know, when I click in the report “Close designview” the report is closing. My mainform appears and then I need the code (which in report or form) that perform automatically the click event.
Code:
Private Sub lblFilterUit_Click()
Hope somebody can help me.
Greetings ahc,
-
Use the on close event of the report.
Code:
Private Sub Report_Close()
'do whatever you want to do
End Sub
-
Hello,
What do you mean
Quote:
do whatever you want
? Is there no code follow up?
I don’t understand.
greetings ahc,
-
on design view (from Navigation pane), no Report Event takes place.
-
Okay,, Is there a code that works in reportview?
-
it will work on Report View.
First make the click event of the label as Public not Private, example:
Code:
Public Sub lblFilterUit_Click()
MsgBox "You Invoked the Click event of Label lblFilterUit!"
End Sub
on the Close event of your Report, add this code:
Code:
Private Sub Report_Close()
DoCmd.OpenForm "MainForm"
CallByName Forms("MainForm"), "lblFilterUit_Click", VbMethod
End Sub
-
hello arnelgp,
Its working :yes thank you
Tonc
-