if statement date comparison in vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stupot1987
    New Member
    • Jun 2007
    • 8

    if statement date comparison in vb6

    im tryin to create an if statement that reads

    if the date inserted into txtdate.text doesnt lie between 01/01/2005 and todays date then please enter one in these boundaries.

    Any ideas my statement isnt workin propely i dont get errors when it should do!
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Change the text in txtdate.text to date format and then compare.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by stupot1987
      Any ideas my statement isnt workin propely i dont get errors when it should do!
      Can you show us how you're doing the comparison now?

      At a guess, you're trying to compare them as strings rather than date values. Which I believe is what debasisdas was getting at.

      Comment

      Working...