Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    413

    Unanswered: Multiply 2 controls

    I am having a problem with my decimal points. On my form I have an unbound textbox that correctly shows the sum of 2 bound controls.However I have a bound control that incorrectly shows the sum of the unbound textbox.The unbound textbox shows $19.50 whereas the bound control shows $20.00

    In my table for the bound control name MaterialTotal I have the format set to
    Long Integer
    Currency
    2

    What am I doing wrong? The table incorrectly shows $20.00 instead of $19.50 as well.

    Here are my table fields and their properties,there are 3 of them

    Customer Rate Number
    Long Integer
    Currency
    Default=65
    ______________________________
    Matl Mark Number
    Long Integer
    General Number
    ______________________________
    MaterialTotal Number
    Long Integer
    Currency

    I multiply the first 2 to get the total of the last one.
    Last edited by Burrina; 12-04-11 at 16:58. Reason: Further Explanation

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    my guess would be that either the control is bound to a column, or you are setting the value. the fact that its $20 suggests to me you have bound the control


    another possibility is that the control is formatted as integer. check its properties or set the unbound control to say $19.49
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2011
    Posts
    413
    I am not setting the value and it's not bound to a column.Using the table where all 3 fields are from the return field shows 20.00.The only value assigned is the default one for the field Customer Rate and that value is =65. They are all Long Integer. I am still lost as to how to make it correctly calculate 19.50 instead of 20.00.
    Thanks

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by Burrina View Post
    ...I have the format set to
    Long Integer
    Currency
    2

    What am I doing wrong?
    Healdem has given you the answer. You have the Datatype for the Field set to Number and the Field Size set to Long Integer, and Formatting it as Currency isn't going to override that!

    Go back into Table Design View and change the Field's Datatype to Currency and it should behave as you want it to.

    But you need to understand that the current Values in the stored in the Table will remain as they were saved, unless you do something to cause them to be recalculated.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Nov 2011
    Posts
    413
    OK,I guess I am just brain dead from all of this.I set all of my data types to currency.But now I cant use [Customer Rate]*[Matl Mark] to get my total,it says.
    The database engine does not recognize either the field Customer Rate in a valid expression or the default value in the table customers.
    See Examples,Please.I still cant get a total.
    Attached Thumbnails Attached Thumbnails tbcustomers.png   tbldata.png  
    Last edited by Burrina; 12-04-11 at 19:52. Reason: Form Examples

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    bear in mind that changes to the table don't affect already designed forms and reports.
    so you will beed to make certain that the forms and reports are also set to the currency format.

    there can be a world of difference between how a value is stored and how it is displayed. a classic example of this is the datetime datatype which is stored as a number NOT a dd/mm/yyyy value. you can derive the date format from the datetime datatype
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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