Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2003
    Location
    netherlands
    Posts
    25

    Red face Unanswered: show current date/month

    hi
    i have a form that shows all trucks that have been there to unload

    now it shows al days i want to show only the ones of the current day
    can sombody point me in the right way on how to do this

    thanx

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Don't be down Max. Date() function returns today's date.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Sep 2003
    Location
    netherlands
    Posts
    25
    thanx for your help

    it was so simple i didn't think of it
    can the same be done if you only want to show current month ?

    greatings
    Max

  4. #4
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Month(date()) will give you the number of the current month e.g. Today (August) will return 8.

    Chris

  5. #5
    Join Date
    Sep 2003
    Location
    netherlands
    Posts
    25
    hi
    month(date()) is not working in
    ive tried other things but sofar nothing works

    any other idees?

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    If you pop
    ?Month(Date())
    in the immediate window (Ctrl + G from Access then Ctrl + G again when in the VBA IDE) and hit return what do you get?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Sep 2003
    Location
    netherlands
    Posts
    25
    nothing happend using Ctrl+g

    the text is there month(date())
    but nothing is filterd

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ok - forget the shortcuts.

    Click Tools-> Macro -> Visual Basic Editor

    This will launch the VB window.

    Once launched clock

    View -> Immediate Window

    In the Immediate Window paste:

    ?Month(Date())

    and hit enter. What is the result?

    ---------
    EDIT (corrected typo)
    Last edited by pootle flump; 08-06-06 at 05:34.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  9. #9
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Quote Originally Posted by max_down
    the text is there month(date())
    but nothing is filterd
    Where and how exactly are you trying implement this ? There are several ways to apply the filter to your form depending on your ultimate aim. The simple method to apply this filter is in a query and base your form on the query:

    SELECT myDate
    FROM myTable
    WHERE Month([myDate])=Month(Date());

    Try the above query on your table to convince yourself that it works. The above assumes you have a table called myTable with a field you wish to filter on called myDate. Note that this will return all records in August for every year.

    Quote Originally Posted by pootle flump
    Click Tools-> Macro -> Visual Basic Editor

    This will launch the VB window.
    I don't think this method works in Access97. Probably easiest to create a new module in 97 (?)

    Quote Originally Posted by pootle flump
    In the Immediate Window paste:

    ?Month(Date()))
    Watch out for pootle's typo (too many close brackets)

    Chris

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by howey
    Watch out for pootle's typo (too many close brackets)

    Chris
    Oops Corrected
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    date() sometimes works, sometimes doesn't and i never have discovered why.
    if Date() wont do it, have a go replacing Date() with Now()

    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •