Results 1 to 5 of 5
  1. #1
    Elfi is offline Novice
    Windows 8 Access 2016
    Join Date
    Mar 2016
    Posts
    3

    problem with calculated fields in Access 2016

    Hello everyone,

    I am facing a problem in Access, that by now gives me some headache, so I am hoping for some help from you guys.

    I am working in a small company, that is renting skylifts. We do our rental contracts in Access, and now it is my duty to get out from theses contracts the according invoice for our clients.
    Therefore I am working now with calculated fields, which worked quite well until this moment. So I have 6 fields in my database (all of them are already calculated fields) as seen below.

    [Bühnenpreis_gesamt]+[Versicherung_gesamt]+[Transportkosten_gesamt]+[Sonderposten_gesamt]+[Sonderposten#2_gesamt]+[Sonderposten#3_gesamt]

    Now I want to add these fileds together, which is not working, because some of the fields are without value. After some research I have tried this:

    Nz([Bühnenpreis_gesamt];0)+Nz([Versicherung_gesamt];0)+Nz([Transportkosten_gesamt];0)+Nz([Sonderposten_gesamt];0)+Nz([Sonderposten#2_gesamt];0)+Nz([Sonderposten#3_gesamt];0)

    Access is telling me now, that this expression can not be used in a calculated column.



    Can anyone help me fixing this problem? Thank you very much. I appreciate it.

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,444
    you cannot use functions such as nz in a calculated field.

    Although access provides the functionality, in reality they are usually more trouble than they are worth. - You should not really be storing calculated values, but calculate them when you need them in a query

  3. #3
    Elfi is offline Novice
    Windows 8 Access 2016
    Join Date
    Mar 2016
    Posts
    3
    Thank you for the quick reply Ajax. My aim was though to merge the values of these fields from access table view into a word document that is an invoice template. Is there no possibility to calculate fields that have no value inside of them?
    I could of course put them on "0", but then I have on every invoice the issue that I must edit away these "0`s" in the word doc.

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,444
    Is there no possibility to calculate fields that have no value inside of them?
    within a table no - as suggested, use a query rather than a table.

    Code:
    select Nz([Bühnenpreis_gesamt];0)+Nz([Versicherung_gesamt];0)+Nz([Transportkosten_gesamt];0)+Nz([Sonderposten_gesamt];0)+Nz([Sonderposten#2_gesamt];0)+Nz([Sonderposten#3_gesamt];0) as calcfield
    
    From myTable

  5. #5
    Elfi is offline Novice
    Windows 8 Access 2016
    Join Date
    Mar 2016
    Posts
    3
    Ok, will do that! ...and probably be back. Thank you Ajax.

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

Similar Threads

  1. Access 2016 Help Button?
    By Charles Hobbs in forum Misc
    Replies: 2
    Last Post: 12-16-2015, 09:39 PM
  2. Access 2016
    By Gina Maylone in forum Access
    Replies: 3
    Last Post: 12-11-2015, 09:44 PM
  3. Replies: 4
    Last Post: 11-29-2015, 03:51 AM
  4. What's new in Access 2016
    By pbaldy in forum Access
    Replies: 6
    Last Post: 09-28-2015, 12:41 PM
  5. Replies: 12
    Last Post: 10-01-2013, 12:59 PM

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