Results 1 to 8 of 8
  1. #1
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159

    Programming a date field

    Hi all,



    I need help please.

    I need to create a program in access which, upon putting in a date in a particular field, there is another date field which is calculated based on the date that was primarily input.

    The calculated field will be 10 years from the input date.

    Also, would it be possible to have a timer that counts down from ten years once the first date has been input?

    Any advice or opinions on this would be great....deadlines are looming!

    Thanks in advance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Calculations can't be done in tables (unless you want to buy Access 2010). Do calculations in queries or in textboxes on forms/reports or in code. A timer for 10 years - can't even imagine that. You can do a query that will filter for records that meet given date criteria.

    Check out date functions in Access Help or review this http://www.techonthenet.com/access/functions/
    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
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Quote Originally Posted by June7 View Post
    Calculations can't be done in tables (unless you want to buy Access 2010). Do calculations in queries or in textboxes on forms/reports or in code. A timer for 10 years - can't even imagine that. You can do a query that will filter for records that meet given date criteria.

    Check out date functions in Access Help or review this http://www.techonthenet.com/access/functions/
    I know calculations in tables are a bad idea. Ya, I thought the timer thing sounded a bit crackers myself - clients making demands though, ya know - weren't happy with the query, filter thing!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Could have code that would run automatically when project opens and check records against the age criteria and then popup a message or form or report.
    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.

  5. #5
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Sounds like something worth pondering that does. no idea where to start wit& that but will definitely have a think about it. Cheers!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Could be an autoexec macro or VBA behind a form that is set by project properties to open on default.
    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.

  7. #7
    Richie27 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Location
    Ireland
    Posts
    159
    Quote Originally Posted by June7 View Post
    Could be an autoexec macro or VBA behind a form that is set by project properties to open on default.
    Hey, thanks again for the idea.

    I was just wondering about one thing though.

    I previously build an access 2007 database on a Windows xp operating system and did some basic coding and macros, which worked as expected.

    However, when I copied the file on to a Windows 7 machine, a lot of my code and macros did not work properly anymore.

    So, what I am wondering is this - is it reasonable to expect code or macros that I program now to work several operating systems down the line??

    I realise that xp came out before access 2007 so I was thinking that the code not working was related to the fact that windows 7 came out after access 2007.

    What are your thoughts on this?

    I'm a big fan of keeping things simple and think the date/query filter thing is by far the best option.


    Thanks again.

    .

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I haven't used Windows 7 yet but I have seen other postings discussing issues with Access 2007 running under it. Think I might be able do some testing next week.

    I think it's reasonable to expect Microsoft programs to run forever under any future MS operating system. But I'm just a user, MS might not share my opinion.
    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. Getting Just the Date part of Date/Time field
    By GaryElwood in forum Reports
    Replies: 7
    Last Post: 09-28-2011, 09:58 AM
  2. Replies: 1
    Last Post: 02-06-2011, 06:36 PM
  3. Set date field on subform to date variable
    By laavista in forum Access
    Replies: 4
    Last Post: 06-30-2010, 06:32 PM
  4. set date field on form to date variable
    By laavista in forum Access
    Replies: 3
    Last Post: 06-28-2010, 03:03 AM
  5. Programming a result field in a table
    By Linda in forum Programming
    Replies: 9
    Last Post: 07-13-2009, 08:07 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