How to use if then with date to close application?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    How to use if then with date to close application?

    I would like to close my application on or after a specific date.
    This code closes it without reaching the planned date.
    datetime field = Date()

    Code:
    If Forms![MainF]![datetime] >= "14/02/2011" Then DoCmd.Quit acSave
    please help
  • neelsfer
    Contributor
    • Oct 2010
    • 547

    #2
    I thought i can get it to work, but no luck. It closes the application whatever >= date i use. please help

    Comment

    • neelsfer
      Contributor
      • Oct 2010
      • 547

      #3
      got it right!
      Code:
      If Me.datetime >= #2/14/2011# Then DoCmd.Quit acSave

      Comment

      Working...