Results 1 to 8 of 8
  1. #1
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    61

    Angry issue with variables in recordset - currency delivers different decimals in different tables

    sorry this my first attempt to get help with bulding my acounting database with access 2013 (win7 pro)

    I have a table FL and a form FL where I enter each line, (whether I get or spend money) the date, amount VAT...., and select, on which account nummer to debit and to credit
    when I have finished these I run a Visual Basic Code "recordset" (to enter these data in another table FJ splitting the information in separate lines, for each account number .. 2 and more lines (in the Form FJ I can see all these lines and controll them)
    ...
    rs!FJSOLLbrutto = Me.FLbrutto And rs!FjHABENbrutto = 0 ( the value of me.flbrutto is 120,- )
    rs!FJSOLLUST = Me.FLUST And rs!FjHABENUST = 0 (the value of me.flust is 10,91 )
    rs!FJSOLLnetto = Me.FLnetto And rs!FJHABENnetto = 0 (the value of me.flnetto is 109,09)


    .....
    my problem now is:
    the values shown in the table FJ are
    FJSOLLbrutto 120,-
    FJSOLLUST 11,--
    FJSOLLnetto 109,--

    i have declared all fields - which contain money-amounts - in all tables as currency, with 2 decimals (same result with currency + fixed)
    the amounts are shown correctly in the form and table FL
    but:
    they are no longer shown correctly in the table FJ, after having them inserted per recordset....
    but as shown above, I haven't declared any (new, different) variables for the amounts to be copied, only the fieldnames...
    why does access suddenly show rounded amounts in the new table????
    and what do I have to do, to avoid this problem?

    would be very grateful if you could help me!!! but please make it simple, my Englisch as well as my Access Knowledge is limited!!!

  2. #2
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    My first thought is if you're making an accounting app you're tackling a complicated project and also reinvinting the wheel.

    Second, I don't quite follow your psuedo code, can you post your actual code? Or even a zipped version of your db file if you'd like.

    (edit)

    oh, what datatypes are you using in your different tables. Sounds like one table is getting rounded to an integer. Make sure they're currency data types.

    (edit x2)
    ok, it sounds like you have done that. Can you check the actual formatting property of these fields?

  3. #3
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    61
    not qite reeinventig the wheel, but the routine I'ven been used to for 20 years with a professional programme, which I have no longer access to, (retired) :-)

    my code is a 1:1 copy - but only part of the whole (... which is much longer ...)
    by these three lines I only wanted to show, that that the values which I want to be inserted in the other table, are not declared as new variables in the code, but I only use the values of the fields in the fist table...

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I think I'm being think but I'm not understanding the AND bit here in red;

    rs!FJSOLLnetto = Me.FLnetto And rs!FJHABENnetto = 0

    By using an AND it will behave like a boolean which will only ever return an Integer no matter what value. (I think)
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    61
    thank you, I made a new line instead of AND and this seems to work
    will change my whole code like this and tell you if this was it:-)



  6. #6
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    61
    thank you so much!!!! I was about to give up....

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by brigitteAT View Post
    thank you so much!!!! I was about to give up....
    Glad to help, good luck with your project.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    61
    thanks for your help, fortunally meantime minty has solved my problem :-)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. problem with setting variables for currency data types
    By jlawson258 in forum Programming
    Replies: 5
    Last Post: 11-02-2020, 12:53 PM
  2. format currency to 5 decimals
    By BobW2961 in forum Access
    Replies: 5
    Last Post: 02-03-2020, 11:52 AM
  3. Decimals, formatting maybe currency.
    By Perfac in forum Programming
    Replies: 3
    Last Post: 01-27-2018, 09:24 AM
  4. Replies: 1
    Last Post: 08-29-2016, 08:04 PM
  5. Export to .txt Issue: Field Returning 2 Decimals
    By SoSubaruMe in forum Import/Export Data
    Replies: 0
    Last Post: 02-27-2012, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums