Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting Date Comparisons (2003)

    What is the correct way to format the following line of code:
    <font color=red> If Format(Me.text0, "mm/dd/yyyy") < #12/1/2007# Then </font color=red>
    for the Click event of the Comando16 button on the startup form of the attached mdb
    so that the conditions in the If...Then...Else block are properly met?
    I've tried several but can't seem to find the right one <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting Date Comparisons (2003)

    Don't use Format - it results in a string instead of a date value. Use this:

    If Me.text0 < #12/1/2007# Then

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting Date Comparisons (2003)

    Thank you so much Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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