Results 1 to 3 of 3
  1. #1
    harishduttpathak is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    1

    Red face Please help me in access

    I am creating a small database in access for maintaining some data. My question is as under, please help.

    I made a table in access and put a column contract_end_date. I just want if the current date(means today date) is greater than the contract_end_date status automatically comes "closed" in the next cell and if the contract_end_date is less than current date(means today date) status automatically comes "Active" in the next cell. If I put any date like 01-jan-2014 in the contract_end_date as it is less than current date(26-jun-2015) it shows status "Active". If I keep contact_end_date blank, status shows "Closed".

    It is necessary to put date in contact_end_date column for records.
    Contract_End_Date Contract_Period Status




    Closed
    31-Mar-2017 2 Active


    Closed
    30-Jun-2016 3 Active
    30-Nov-2015 3 Active
    31-May-2015 1 Active
    31-Oct-2017 3 Active
    31-Jan-2016 1 Active
    30-Sep-2015 2 Active


    Closed
    31-Mar-2016 1 Active
    12-Jul-2016 2 Active
    30-Nov-2017 3 Active


    Closed
    30-Nov-2018 4 Active


    Closed

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    As a general rule, saving calculated data (data dependent on other data) is not advisable. This status value can be calculated when needed. If you do want to save, that will require code (macro or VBA) or an expression in table Calculated type field.
    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.

  3. #3
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Is this something you want to do one time? Or this a procedure you would like to do at the click of a button every so often? Or is this something you want like June7 said, a calculated field.

    For the first two options I listed, you could simply do update queries.

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

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