Results 1 to 6 of 6

Thread: unloading Active reports

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    919

    unloading Active reports

    Hello
    I'm having big trouble to unload my active report from another form.
    Code:
    Unload Activereport1
    Set ActiveReport1 = nothing
    these codes are not unloading the Activereport.
    Any suggestion?
    thanks
    Last edited by newbie2; Oct 21st, 2021 at 07:41 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: unloading Active reports

    If you make a reference to a control after you unload it then you are effectively reloading that control.

    Get rid of the second line.

  3. #3
    Lively Member
    Join Date
    Nov 2020
    Posts
    67

    Re: unloading Active reports

    Quote Originally Posted by DataMiser View Post
    If you make a reference to a control after you unload it then you are effectively reloading that control.

    Get rid of the second line.
    I Agree 100%

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    919

    Re: unloading Active reports

    I'm so sorry
    I was just mistaken
    The codes are:
    Code:
    Unload Activereport1
    Set ActiveReport1 = nothing
    these codes are not unloading the Activereport

  5. #5
    Lively Member
    Join Date
    Nov 2020
    Posts
    67

    Re: unloading Active reports

    ActiveReport1 is not an 'object variable', but it is a real object and cannot be set to Nothing, that statement is useless and must be removed because you cannot 'download' the report!


    It would be like if you wanted to download a TextBox using Set TextBox = Nothing, it doesn't make sense.



    In my projects I only ever use Unload.

    It would be like if you wanted to download a TextBox using Set TextBox = Nothing, it doesn't make sense.


    In my projects I only ever use Unload.

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: unloading Active reports

    An Unload should be all that is needed. If that doesn't work then there is something else going on and would need more info as to how the report is loaded and where that unload statement is located.

    For example
    Code:
    ActiveReport1.Show 1
    Unload ActiveReport1
    Will not work because the unload code will nto run until the report is hidden or closed.

Posting Permissions

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



Click Here to Expand Forum to Full Width