Results 1 to 6 of 6
  1. #1
    baronqueefington is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    32

    Help with updating table field using query or form? (newbie)

    Good evening,

    Firstly I am fairly new to access, I have a table holding clients data, I need it to work out the age of someone when an application is made, which I would like to be stored on said table

    I have two fields [DOB] and [signed date], which I have used created a query with and an (unbooud?) field called age at application with the expression =DateDiff("yyyy",[DOB],[Date signed])

    This works fine when I run the query, but I am unsure of the new next step of how to commit it to the table and even if that's possible.

    Ideally I would like this to run behind a form maybe using some click event after the [signed date] field has been entered.



    I currently don't know the best avenue to take, so would much appreciate it if someone could point me in the right direction.

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    I would not recommend to store calculated value.
    You can use the same calculate on the form.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    As lfpm stated, no need to save age into table, calculate when needed. Saving would require code (macro or VBA).
    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.

  4. #4
    baronqueefington is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    32
    Hello,

    Thank you for your reply, I have read else where that recording calculated data is a bad idea, but I am still unsure why this is.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Because raw data and the saved calculated data can become 'out of sync' and this is especially true with aggregate calcs. If raw data is edited then the saved calcs must be re-calculated and saved again. I know this doesn't really apply in your case - DOB is not likely to be changed. Still, the extra field in table and the effort to save data is just not necessary.
    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.

  6. #6
    baronqueefington is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    32
    Hello,

    thank you for all of your replies, I have taken on board what you have said and will use a form to calc as and when.

    Thanks.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-13-2014, 08:00 PM
  2. Replies: 14
    Last Post: 09-13-2012, 01:15 PM
  3. Updating Yes/No field in a table via a query
    By immortal_dranzer in forum Queries
    Replies: 12
    Last Post: 03-22-2012, 12:32 AM
  4. Replies: 5
    Last Post: 07-01-2011, 11:13 AM
  5. Updating Table field from Form
    By Kunuk in forum Access
    Replies: 0
    Last Post: 02-26-2009, 11:41 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