Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144
    Thanks Joe.



    Steve, only slightly familiar with VBA. Would this line of code need exact year and date entered? DateToCheck = DateSerial(Year(Date), Month(Date), 1)

  2. #17
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It is all taken care of in the code.

    The date function, Date(), returns the current date.
    The date serial function, DateSerial(Year(Date), Month(Date), 1), calculates the first of the month. (look up dateSerial in Help)

    Every time the dB is opened, the code runs. If there is not an entry for the current month, the append query is executed; if there IS an entry in the table for the current month, the code falls through without running the append query. So the append query executes only once per month, no matter how many times the dB is opened in a month.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Append Query
    By Kelsey in forum Queries
    Replies: 7
    Last Post: 11-08-2011, 11:38 AM
  2. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  3. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  4. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 AM
  5. Append Query
    By cotri in forum Queries
    Replies: 1
    Last Post: 01-28-2010, 08:52 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