Very strange error (About DATE)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    #1

    Very strange error (About DATE)

    I am using vb6.

    Now , I am facing a very strange error. I think it might be due to some other problem rather coding not sure.

    Actually , i have put a datepicker in the form and at the load even of form i had use the code

    Code:
    Date1.value= Date
    whice change datepicker date to current system date.

    Now , i rememberer this was workig fine but when today i comiple and run my progrme , the date is not appearing to the curretn date.

    I had checkek there was not syntax error , but amazingly when i show a message box it , its works fine.

    Like if i write

    Code:
    Date1.value= Date
    Msgbox Date1.value
    Now, datepicker in my form show the current system date.

    I am not sure what difference that msgbox is doing.

    Did any body of you ever accured this type of problem.

    Even i had tried to use the code.

    Code:
     Date1.value = Date
    at activate event , but it will not show correct date until i use a msgbox ?

    So strange? donot know what to do. Is there any thing wrong with my sytem date?
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    DTP.Refresh...



    Good Luck

    Comment

    • muddasirmunir
      Contributor
      • Jan 2007
      • 284

      #3
      Well this does not work.

      Actually , i had modified some code.

      I am calling now a function at the load event (I had also set teh value of datepicker equal to current date at load event) , that function first call a function in the same form and the called function again call a function present in the module.

      When i disable the functions , the date works fine , but when i enable the function the date does not set to curretn date.

      By the way , the was nothing done to datepicker in those functions.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by muddasirmunir
        Well this does not work.

        Actually , i had modified some code.

        I am calling now a function at the load event (I had also set teh value of datepicker equal to current date at load event) , that function first call a function in the same form and the called function again call a function present in the module.

        When i disable the functions , the date works fine , but when i enable the function the date does not set to curretn date.

        By the way , the was nothing done to datepicker in those functions.
        Just a thought - can you try setting a watchpoint to break whenever the .Value parameter changes? That'd tell you for sure whether anything is messing with it.

        However, from what you said in your original post, it sounds as though the value is set correctly, but the display is simply not refreshed. You might try experimenting with .Refresh, Doevents and similar.

        Another thought - could you start out with the datepicker not visible, then make it visible after setting the value? Perhaps that would force the issue.

        Also, just out of curiosity, what value is displayed when it doesn't update correctly? When I add a DatePicker control, it seems to start out with the current date in it without any action on my part.

        It might help also if you could give us some idea of what those other functions do.
        Last edited by Killer42; Jul 17 '10, 04:44 AM. Reason: Just thought of a little more that needed adding.

        Comment

        • muddasirmunir
          Contributor
          • Jan 2007
          • 284

          #5
          I had studied it more , now i came that the error is causing becuase i use the keyword

          date1.setfocus at activate event of form , when i remove this the date work fine.

          Another thing is i am usign skincrafter, to skin the form d, i though this might be causing problem.

          Comment

          Working...