Results 1 to 2 of 2
  1. #1
    Aosmond is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jan 2013
    Posts
    8

    Form date field with warning

    I have a form that has three date fields [WeekOne], [WeekTwo] and [WeekThree]. When someone enters date on the first field [WeekOne], in the second week I want to be defaulted to seven days from the first week. For example if I type 01/01/2013 in week one, I want the week two field to be defaulted to 01/08/2013, but also I want to be able to change it. But if I decide to change and I type date that is more than 7 days or less than seven days from the first week I want to see a warning saying "Are you sure this is the correct date" and by clicking Ok I can make the changes. Also I would like to have the same situation in week three. it also should be seven days from the week two. can you please help how to code this in the form. I have MS Access 2003. Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Code in AfterUpdate event of WeekOne could populate the WeekTwo and WeekThree fields. Something like:

    If IsNull(Me.WeekTwo) Then Me.WeekTwo = Me.WeekOne + 7
    If IsNull(Me.WeekThree) Then Me.WeekThree = Me.WeekOne + 14

    Then code in BeforeUpdate events of WeekTwo and WeekThree could ask user:

    If MsgBox("Are you sure this is the correct date?", vbYesNo) = vbNo Then
    Cancel = True
    EndIf
    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. Replies: 3
    Last Post: 11-20-2012, 01:40 PM
  2. Replies: 1
    Last Post: 11-13-2010, 12:57 PM
  3. Warning Message for Missed Date
    By maintt in forum Access
    Replies: 2
    Last Post: 07-23-2010, 09:05 AM
  4. Review Date on A Form Warning
    By maintt in forum Forms
    Replies: 3
    Last Post: 07-19-2010, 02:28 AM
  5. set date field on form to date variable
    By laavista in forum Access
    Replies: 3
    Last Post: 06-28-2010, 03:03 AM

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