Results 1 to 3 of 3
  1. #1
    rolyjavier is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2019
    Posts
    1

    Calculated Field

    Hello community,

    I want to know if its posibble to make a calulated field in a table with this conditions:



    • There is a "Yes/No" field , an "Date of Visit" and a "Next Date of visit" fields

    So, what I want to make is: If, the "Yes/No" field is checked(like in the picture), I want to add +30 days to "Date of Visit" and display it on "Next Date of Visit" field

    I came up with this expression, but is not working:
    Code:
    IIf([Subscription]=Yes,[DateOfVisit]+30,"On Call")
    Attached Thumbnails Attached Thumbnails Annotation 2019-06-15 213533.png  

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Table calculations are
    1) quite limited, and I'm pretty sure IIF functions are not possible
    2) ill advised

    Do your calculations in queries and forms and don't save them, except in rare cases. "next date" is not one of those cases.

    Other notes - I don't see a "Next Date of visit" field.
    Don't know what type of file your "comments" attachments is, but db size can get pretty big if you keep attachments in Access tables. Often, developers will store the path to the file as simple text in the table field and use it to access the file.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    IIf() is available to calculated type field in table.

    What does 'not working' mean - error message, wrong result, nothing happens?

    I just tried this and get error message trying to save the table.

    I think the expression is rejected because mixing data types in the result.

    Do calc in query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-09-2019, 05:38 PM
  2. Replies: 1
    Last Post: 12-10-2017, 01:47 AM
  3. Replies: 1
    Last Post: 05-22-2017, 05:59 AM
  4. Replies: 3
    Last Post: 04-09-2017, 08:01 PM
  5. Replies: 2
    Last Post: 12-30-2014, 01:32 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