Results 1 to 2 of 2
  1. #1
    tosv1516 is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    2

    How to use autoexec combined with date() or Now()

    Hi.
    I have read a lot , but not found a solution to achieve the following:
    In a db I wish to get to a post of the current day as now() or date() , if it exist.
    If not exist a record holding today's date, I wish to create it, and then work with it ( set focus ).
    The purpose is to have an autoexec that either show the current already started record for today,


    or create a new one to work with, and avoid getting double posts in the db.

    Is there a simple yet effective solution to this ??

    Best regards....
    Torgeir

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    I had a similar problem, and I solved it by creating a table especially

    to determine if today was a new day. If the reference date was less than today, I entered today's date into the reference table and carried out the special action. The concept works whether you are working on daily, monthly or yearly actions. Hourly and minute by minute actions could work as well.
    However, if you already have a table that contains a date which could be reference as the last update, then you wouldn't need another table.
    Since you are concerned about day intervals, you need to do your comparison with value in which the smallest unit is days.
    Google "access date functions".
    Date() might be sufficient but I believe that for some reason I constructed a date value using Date(), DatePart, and DateSerial.

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

Similar Threads

  1. Help Stopping AutoExec Macro
    By drewetzel in forum Access
    Replies: 2
    Last Post: 10-03-2011, 10:51 AM
  2. Autoexec
    By Madmax in forum Programming
    Replies: 2
    Last Post: 07-12-2011, 11:33 AM
  3. Combined Reports
    By baum12 in forum Reports
    Replies: 1
    Last Post: 05-05-2011, 03:19 AM
  4. AutoExec Mistake
    By HawkGuru in forum Programming
    Replies: 1
    Last Post: 04-23-2011, 04:48 AM
  5. Using parameter in autoexec macro
    By lchurch in forum Queries
    Replies: 0
    Last Post: 03-04-2009, 06:22 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