Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Controll date in txtbox (2000 sr 1)

    i have insert this controll:

    If Me.Textbox2.Value > Now Then

    MsgBox "DATA NON CORRETTA, MAGGIORE DATA ODIERNA! RIPETERE", vbExclamation
    Me.Textbox2 = ""
    Exit Sub

    End If

    but if i insert 14/01/2000 go in msgbox error, why?

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

    Re: Controll date in txtbox (2000 sr 1)

    The value of TextBox2 is a string, not a date. You can use CDate to convert the string value to a date:

    If CDate(Me.TextBox1.Value) > Now Then

Posting Permissions

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