Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62

    Unanswered: Avoiding Close Event on Report

    Is there any way to avoid or bypass the CLOSE Event on an object? Or is there a better way to do this ...

    I have a report that, when closed I run some code to update some fields in a table.

    I have put some code in the No Data event in order to catch when there is a No Data situation. However, the Cancel = True in my No Data event then triggers the close event. Which in turn runs the code that should not be run if there is no data in the report.

    I hope this clearly written. I am stuck.

    Any help is appreciated.

    Jack

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    It's a bit of a hack...

    But you could declare a boolean variable within the report and encapsulate your OnClose event within an if statement. Then you could evaluate your variable before executing the onclose.

    In the NoDate event, you could set a global report variable to false, then in the OnClose event you could have something like:

    If YourVar = False Then
    Exit Sub
    Else
    rest of onclose code
    end if

  3. #3
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Teddy,

    I don't think that that is a hack--it's exactly what you've got to do.

  4. #4
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62
    Ah, good idea.

    I guess I hoped for DONOTRUNCLOSEEVENT() the unknown procedure.

    I dont suppose the property value
    Cancel = True
    from the No Data event is available to my Close event?

    Thanks,
    Jack

    Originally posted by Teddy
    It's a bit of a hack...

    But you could declare a boolean variable within the report and encapsulate your OnClose event within an if statement. Then you could evaluate your variable before executing the onclose.

    In the NoDate event, you could set a global report variable to false, then in the OnClose event you could have something like:

    If YourVar = False Then
    Exit Sub
    Else
    rest of onclose code
    end if

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by Jaash
    Ah, good idea.

    I guess I hoped for DONOTRUNCLOSEEVENT() the unknown procedure.

    I dont suppose the property value
    Cancel = True
    from the No Data event is available to my Close event?

    Thanks,
    Jack
    I don't think so. Mainly because the NoData code is a Sub, and subs don't return values. You can't reference it as an object or a function, so I don't think you can retrieve any "properties" from it.

  6. #6
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62
    Many thanks for the feedback.


    Jack

Posting Permissions

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