Open form showing only Dates in the future

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wb228
    New Member
    • Mar 2008
    • 2

    Open form showing only Dates in the future

    Hi,

    I have a form called "2_Form_Courses " and in my menu I open the same form, just applying different filters.

    My upcoming courses button doesn't work with dates properly

    When I run this today (1st March) it should only show 2 records, for the 27th April and 25th May
    [code=vb]
    DoCmd.OpenForm "2_Form_Courses ", acNormal, , "[Date] > #" & Now() & "#"
    [/code]
    It worked ok until recently, but now also shows 17 Feb 2008 (which is in the past) and I cannot understand why.
    Last edited by JKing; Mar 1 '08, 09:19 PM. Reason: [CODE] Tags
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Originally posted by wb228
    Hi,

    I have a form called "2_Form_Courses " and in my menu I open the same form, just applying different filters.

    My upcoming courses button doesn't work with dates properly

    When I run this today (1st March) it should only show 2 records, for the 27th April and 25th May
    [code=vb]
    DoCmd.OpenForm "2_Form_Courses ", acNormal, , "[Date] > #" & Now() & "#"
    [/code]
    It worked ok until recently, but now also shows 17 Feb 2008 (which is in the past) and I cannot understand why.
    Try this instead:

    [code=vb]
    DoCmd.OpenForm "2_Form_Courses ", acNormal, , "[Date] > Date()"
    [/code]

    Comment

    • wb228
      New Member
      • Mar 2008
      • 2

      #3
      Many thanks,

      That did it.

      Comment

      Working...