Results 1 to 4 of 4
  1. #1
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67

    Calculate Date Field


    Hello again folks,

    I'm trying to write some code to add on business days for a follow up.

    In the after update of my field I have;

    If [Date Modified] = (Weekday(Date) = 1) And [Status] = "submitted" Then
    [ActivatorFollowUpDate].Value = [Date Modified] + 3
    End If
    If [Date Modified] = (Weekday(Date) = 2) And [Status] = "submitted" Then
    [ActivatorFollowUpDate].Value = [Date Modified] + 3
    End If

    so on and so on - the intention is to find the day of the week and add on 3 business days so if it's Friday it will add 5 to the Date Modified and fill that date into ActivatorFollowUpDate

    I'm sure my syntax is totally wrong I just am not sure where to go next

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Do you also need to account for holidays?

    Don't see anything wrong with that syntax. Have you tested it. Are you getting errors?
    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
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    No need to account for holidays at this time

    I have tested it and it does nothing - meaning the field does not update it remains null I also get no errors

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Form is bound to table and the ActivatorFollowUpDate field is in the form RecordSource? Have you step-debugged? Review link at bottom of my post for guidance on debugging techniques.
    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. Help with macro to calculate a date
    By rivkovitch in forum Access
    Replies: 5
    Last Post: 10-29-2012, 11:09 PM
  2. Calculate Date in Query
    By raytackettsells in forum Programming
    Replies: 8
    Last Post: 03-23-2012, 01:44 PM
  3. Replies: 34
    Last Post: 12-01-2011, 08:18 AM
  4. Expr. to calculate 'Age' from Date field
    By JohnB47 in forum Queries
    Replies: 18
    Last Post: 08-17-2011, 04:10 AM
  5. Calculate age from birth date
    By mick in forum Forms
    Replies: 2
    Last Post: 07-03-2010, 04:31 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