Again with old problem !

Discussion in 'Questions (Windows Mobile)' started by gjoisa, Jun 12, 2008.

  1. gjoisa

    gjoisa Active Member Licensed User

    Hi ,
    In my application date will be given by user and a required calculation will be done by application . I used 2 combo boxes , one for dd and another for mm . And for yyyy i used textbox .(I can't use calender control here because it takes lot of time to move 20 to 30 years ) There is one problem . Sometimes date will be shown as 01/01/0001 in my output page . Some times it works correctly . I had came here with same problem some times ago . At that time one suggestion was there to use "txtyyyy.lostfocus" event where "if txtyyyy.text<1000 then txtyyyy.text=1000" ,code should be added. I have tried that also ! The same problem exists .Dear Erel What may be the reason ? What should be done?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    When DateParse fails (date string doesn't match the format pattern) it will return the date 01/01/0001.
     
  3. gjoisa

    gjoisa Active Member Licensed User

    what to do then ? my all calculation results will be false at that case . Why does dateparse fail ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You could add a check like:
    Code:
    d = DateParse(SomeDateString)
    If d = 0 then
      
    'SomeDateString is not a valid date string
    End If
    It fails when the string is not a proper date.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice