Results 1 to 4 of 4
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Future Date Warning VBA Warning, Are You Sure You Want To Use a Future Date

    I have a date field on my orders form that if a user chooses a future date, I want a vba message that asks if they are sure they want to use a future date for this order, then if so, date is allowed, if not, cancel.



    Field name is ShipDate

    Thanks in Advance,

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'd use the form's before update event:

    http://www.baldyweb.com/BeforeUpdate.htm

    In your case you'd test that field against Date() and use a Yes/No message box.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    If Len(Me.ShipDate & vbNullString) = Date > Date Then
    MsgBox "Are You Sure You Want To Use a Future Shipping Date"
    Cancel = True
    Me.ShipDate.SetFocus
    End If


    Will This work?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No. Presumably you mean:

    If Len(Me.ShipDate & vbNullString) >= Date Then

    I also suggested a Yes/No message box. What you have will cancel no matter what the user does.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Calculated Future Dates
    By Monterey_Manzer in forum Forms
    Replies: 5
    Last Post: 10-02-2012, 05:02 PM
  2. Replies: 2
    Last Post: 06-11-2012, 07:04 AM
  3. Future date parameter
    By normie in forum Queries
    Replies: 10
    Last Post: 08-12-2010, 09:38 PM
  4. Warning Message for Missed Date
    By maintt in forum Access
    Replies: 2
    Last Post: 07-23-2010, 09:05 AM
  5. Review Date on A Form Warning
    By maintt in forum Forms
    Replies: 3
    Last Post: 07-19-2010, 02:28 AM

Tags for this Thread

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