Consulting

Results 1 to 8 of 8

Thread: help with on click event

  1. #1
    VBAX Regular
    Joined
    Jan 2016
    Posts
    48
    Location

    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.
    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.
    Private Sub lblFilterUit_Click()
    Hope somebody can help me.


    Greetings ahc,

  2. #2
    VBAX Regular xps350's Avatar
    Joined
    Jul 2022
    Posts
    13
    Location
    Use the on close event of the report.
    Private Sub Report_Close()
        'do whatever you want to do
    End Sub
    Groeten,

    Peter

  3. #3
    VBAX Regular
    Joined
    Jan 2016
    Posts
    48
    Location
    Hello,
    What do you mean
    do whatever you want
    ? Is there no code follow up?

    I don’t understand.



    greetings ahc,

  4. #4
    on design view (from Navigation pane), no Report Event takes place.

  5. #5
    VBAX Regular
    Joined
    Jan 2016
    Posts
    48
    Location
    Okay,, Is there a code that works in reportview?

  6. #6
    it will work on Report View.
    First make the click event of the label as Public not Private, example:

    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:
    Private Sub Report_Close()
        DoCmd.OpenForm "MainForm"
        CallByName Forms("MainForm"), "lblFilterUit_Click", VbMethod
    End Sub

  7. #7
    VBAX Regular
    Joined
    Jan 2016
    Posts
    48
    Location
    hello arnelgp,

    Its working thank you

    Tonc

  8. #8

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •