strange function problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shurstgbr

    #1

    strange function problem

    Access 97. I have a function (called from a very large sub) where the
    parameters are explicitly defined as double. However, on occasion one
    or more of these may be null. My error trapping was set to "Break in
    Class Module". When I have a null parameter, I don't receive any error
    message but the code immediately stopped running at the point the
    function was called. Anyone any ideas whats going on here??

  • Tom van Stiphout

    #2
    Re: strange function problem

    On 19 May 2006 01:53:32 -0700, "shurstgbr"
    <simon.hurst@ca pcissystems.com > wrote:

    If you want a trappable error, put an error handler in the sub, and
    set that Error Trapping value to "Break on unhandled errors".
    You will then get an "Invalid use of null". Only variants can have a
    Null value.

    -Tom.

    [color=blue]
    >Access 97. I have a function (called from a very large sub) where the
    >parameters are explicitly defined as double. However, on occasion one
    >or more of these may be null. My error trapping was set to "Break in
    >Class Module". When I have a null parameter, I don't receive any error
    >message but the code immediately stopped running at the point the
    >function was called. Anyone any ideas whats going on here??[/color]

    Comment

    • shurstgbr

      #3
      Re: strange function problem


      What I actually want to know is why the code stops when it should carry
      on.

      Comment

      • Bob Quintal

        #4
        Re: strange function problem

        "shurstgbr" <simon.hurst@ca pcissystems.com > wrote in
        news:1148053837 .561015.89670@i 39g2000cwa.goog legroups.com:
        [color=blue]
        >
        > What I actually want to know is why the code stops when it
        > should carry on.
        >[/color]
        Why do you believe that the code should carry on?

        Note that an error passing incompatible parameters triggers the
        error at the level of the call, not at the level of the function's
        code.

        The function is in a class module or is called from a class module.

        --
        Bob Quintal

        PA is y I've altered my email address.

        Comment

        • Tom van Stiphout

          #5
          Re: strange function problem

          On 19 May 2006 08:50:37 -0700, "shurstgbr"
          <simon.hurst@ca pcissystems.com > wrote:

          It can't. It cannot pass a Null value as an argument that is defined
          as Double, because Null is not a valid Double.

          -Tom.


          [color=blue]
          >
          >What I actually want to know is why the code stops when it should carry
          >on.[/color]

          Comment

          Working...