Results 1 to 10 of 10
  1. #1
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6

    Calculated Formula on Table

    Hi im new on Access could anyone help me regarding calculated value on access table database.
    I have value01 - value02 = AnswerValue but if the value01 is less than value02 the answer should be negative but did not return value of negative.
    Please help me...



  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Remove the abs(......)

  3. #3
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    Invalid syntax it says.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Should simply be
    [value01]-[value02]

    Note that it is not good practice to have calculated columns in a table.
    It should be done in a query.

  5. #5
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    I try it its syntax error. Regarding this practice what is the effect in the future, if i have calculated columns?

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Regarding this practice what is the effect in the future, if i have calculated columns?
    https://www.datanumen.com/blogs/one-...access-tables/

    I try it its syntax error.

    Click image for larger version. 

Name:	2p2.png 
Views:	19 
Size:	12.1 KB 
ID:	36061

    Click image for larger version. 

Name:	2P1.png 
Views:	19 
Size:	5.3 KB 
ID:	36062

  7. #7
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    Thank you so much davegri got it...

  8. #8
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    But one more thing when you empty the value01 there will be no answer but if you put 0 its correct. Any idea how to write the code?

  9. #9
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Two basic problems here.
    1. You are working with data entry directly into tables. This is bad practice. You should use forms.
    2. You want calculated fields in tables. The calculation should be done in queries.

    Sorry, I can offer no code to help in validating data input directly into tables.

  10. #10
    ngodap is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    Quote Originally Posted by davegri View Post
    Two basic problems here.
    1. You are working with data entry directly into tables. This is bad practice. You should use forms.
    2. You want calculated fields in tables. The calculation should be done in queries.

    Sorry, I can offer no code to help in validating data input directly into tables.
    Thank you so much davegri...appreciate it...

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

Similar Threads

  1. help with access table formula
    By Keeper1984 in forum Access
    Replies: 8
    Last Post: 01-20-2018, 03:11 PM
  2. Replies: 7
    Last Post: 02-08-2017, 02:28 PM
  3. Replies: 4
    Last Post: 11-07-2016, 04:43 PM
  4. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  5. Date Formula in a Table
    By zmbaker in forum Access
    Replies: 8
    Last Post: 08-12-2014, 02:52 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