By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Access 2007 - 2 questions - Merge & calculated date field

P: 2
I have 2 questions regarding my Access db:

1. I have records which will need followup in approx 6 months. Rather than looking up 6 months, what would be good code to calculate 6 months ahead? Also, is there a way to have a popup dialog box when the date of record reviews comes close? I guess an automated query?

2. I have a word merge document set up to use my db as a record source. Is there a way to click a button and have the merge begin in word?

Thanks!
Jul 26 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,616
I have 2 questions regarding my Access db:

1. I have records which will need followup in approx 6 months. Rather than looking up 6 months, what would be good code to calculate 6 months ahead? Also, is there a way to have a popup dialog box when the date of record reviews comes close? I guess an automated query?

2. I have a word merge document set up to use my db as a record source. Is there a way to click a button and have the merge begin in word?

Thanks!
  1. Create a Table named tblFollowup with an [ID] Field that is the Primary Key (AUTONUMBER) and a [Due_Date] Field DATE. This Table has 1 Function, and that is to hold Follow Up Dates.
  2. Whenever you are ready to enter a Follow Up Date, (6 months from the Current Date), run this code:
    Expand|Select|Wrap|Line Numbers
    1. Dim MySQL As String
    2.  
    3. DoCmd.SetWarnings False
    4.   MySQL = "INSERT INTO tblFollowup (Due_Date) VALUES (DateAdd('m',6,Now()))"
    5.   DoCmd.RunSQL MySQL
    6. DoCmd.SetWarnings True
  3. Place this code wherever appropraite to determine if you are within 14 days of the Follow Up Date.
    Expand|Select|Wrap|Line Numbers
    1. If Now() > DLast("[Due_Date]", "tblFollowup") - 14 Then
    2.   MsgBox "Follow Up is due on: " & DLast("[Due_Date]", "tblFollowup")
    3. End If
Aug 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.