Value displayed incorrectly in Recordset

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

    #1

    Value displayed incorrectly in Recordset

    I have a table, with two fields in it.. They're both defined as double
    currency, 4 decimal places.

    When I have a form on top of the recordset, it displays the fields just
    fine.

    When I use VB to open a recordset, when you msgbox the rst!fieldname,
    you get the value only it's multiplied by 100!

    Someone please help with what I'm sure is a simple error I've made
    somewhere.
    Anyone seen something like this before?

    -Brian

  • Allen Browne

    #2
    Re: Value displayed incorrectly in Recordset

    Double currency?

    Is this problem field of type Number (size Double), or is it of type
    Currency?

    And what precisely do you have in the Format and Input Mask properties of
    the field?

    --
    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.

    "BrianDP" <dp_midknight@y ahoo.com> wrote in message
    news:1131393888 .751902.33450@g 14g2000cwa.goog legroups.com...[color=blue]
    >I have a table, with two fields in it.. They're both defined as double
    > currency, 4 decimal places.
    >
    > When I have a form on top of the recordset, it displays the fields just
    > fine.
    >
    > When I use VB to open a recordset, when you msgbox the rst!fieldname,
    > you get the value only it's multiplied by 100!
    >
    > Someone please help with what I'm sure is a simple error I've made
    > somewhere.
    > Anyone seen something like this before?
    >
    > -Brian
    >[/color]


    Comment

    • BrianDP

      #3
      Re: Value displayed incorrectly in Recordset

      Allen (and groupies),

      Thank you so much for replying to my post. I was finally able to dig
      to the bottom of this. The problem centered around scientific
      notation. Before I knew what the problem was, there were some clues
      that gave it away.

      1) Example- The original value was .02348374123, and if I would re-key
      in the value, well, heck, we don't really need that precision, so I'd
      re-key it in as just ".02348", and then there would be no problem!

      2) Only SOME values were a problem, I'd run my program, and watch the
      trace, comparing what it THOUGHT it was pulling as the value from the
      table, and what it really should have been. Many of them were just
      fine!

      SO IN THE END... I set the definition for MC (Material Cost) to

      Field Data Type: Number

      Field Size: Decimal
      Format: General Number
      Precisiooo: 18
      Scale: 4
      Decimal places: Auto.

      Thank you so much Allen for replying, I really enjoy using your web
      site, and having you around when I'm in a jam like this. You are a
      great asset to the Access Community.

      Three Cheers for Allen Browne!!

      Sincerely,
      -BrianDP

      Comment

      Working...