Results 1 to 3 of 3

Thread: Auto date

  1. #1
    Join Date
    Nov 2005
    Posts
    4

    Unanswered: Auto date

    Could someone give this newb some detail instructions on how to make my date auto update. We have issues where people dont enter the date, so I want to set my DB to enter that automaticaly when data is entered. Please let me know thanks

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    access/jet doesn't automate much at all apart from the default values in new records. the rest of the "automation" is down to you-the-coder.

    access function now() gets you the current system datetime
    date() does the same but with the timepart of the datetime set to midnight

    you can use now() as the default value of a datetime field in your table design to set the datetime a new record is created

    you-the-coder can also put that value into a field whenever a suitable event fires. choose your event and insert
    me.myDateField = now()
    ...the magic part is locating an event that suits your purpose.

    mess around with your events.
    try inserting
    msgbox "is this a good place to set the date?",,"nameOfEvent"
    in candidate events until you find the effect you are looking for.

    izy
    Last edited by izyrider; 11-13-05 at 06:02.
    currently using SS 2008R2

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Could someone give this newb some detail instructions on how to make my date auto update. We have issues where people dont enter the date, so I want to set my DB to enter that automaticaly when data is entered. Please let me know thanks
    I'd suggest just putting this into the DefaultValue for the date field:

    =Date()
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •