"Overflow"

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

    #1

    "Overflow"

    Running a particular Access report or the query associated with it
    brings up the warning "Overflow". What does this mean? WhatI have I
    done wrong?

    Both report and query were fine before lunch and the only thing I have
    changed is updated the data from one of the tables it pull info from.

    HELP!!!!!!!!!!! !!!!!!!!
    PLEASE

  • Allen Browne

    #2
    Re: "Overflow& quot;

    Overflow means the number is too large for the data type.

    As an example, open the Immediate Window (Ctrl+G), and enter:
    ? 200 * 200
    It overflows, because the default data type in VBA is Integer (16-bit),
    which runs out at 32767. 40000 is too big, so we must convert one of the
    numbers to a Long Integer (32-bit) so it does not overflow:
    ? CLng(200) * 200

    Use CDbl() to convert to a double, CCur() to convert to Currency, CVDate()
    to convert to date.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Spook" <stephen.lockwo od@sainsburys.c o.uk> wrote in message
    news:1123074771 .370769.220840@ g14g2000cwa.goo glegroups.com.. .[color=blue]
    > Running a particular Access report or the query associated with it
    > brings up the warning "Overflow". What does this mean? WhatI have I
    > done wrong?
    >
    > Both report and query were fine before lunch and the only thing I have
    > changed is updated the data from one of the tables it pull info from.
    >
    > HELP!!!!!!!!!!! !!!!!!!!
    > PLEASE
    >[/color]


    Comment

    • Allen Browne

      #3
      Re: &quot;Overflow& quot;

      Overflow means the number is too large for the data type.

      As an example, open the Immediate Window (Ctrl+G), and enter:
      ? 200 * 200
      It overflows, because the default data type in VBA is Integer (16-bit),
      which runs out at 32767. 40000 is too big, so we must convert one of the
      numbers to a Long Integer (32-bit) so it does not overflow:
      ? CLng(200) * 200

      Use CDbl() to convert to a double, CCur() to convert to Currency, CVDate()
      to convert to date.

      --
      Allen Browne - Microsoft MVP. Perth, Western Australia.
      Tips for Access users - http://allenbrowne.com/tips.html
      Reply to group, rather than allenbrowne at mvps dot org.

      "Spook" <stephen.lockwo od@sainsburys.c o.uk> wrote in message
      news:1123074771 .370769.220840@ g14g2000cwa.goo glegroups.com.. .[color=blue]
      > Running a particular Access report or the query associated with it
      > brings up the warning "Overflow". What does this mean? WhatI have I
      > done wrong?
      >
      > Both report and query were fine before lunch and the only thing I have
      > changed is updated the data from one of the tables it pull info from.
      >
      > HELP!!!!!!!!!!! !!!!!!!!
      > PLEASE
      >[/color]


      Comment

      • Spook

        #4
        Re: &quot;Overflow& quot;

        Cheers for that.

        Stephen

        Comment

        • Spook

          #5
          Re: &quot;Overflow& quot;

          Cheers for that.

          Stephen

          Comment

          Working...