By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,300 Members | 846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,300 IT Pros & Developers. It's quick & easy.

Very strange error (About DATE)

P: 284
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

Expand|Select|Wrap|Line Numbers
  1. 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

Expand|Select|Wrap|Line Numbers
  1. Date1.value= Date
  2. 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.

Expand|Select|Wrap|Line Numbers
  1.  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?
Jul 4 '10 #1
Share this Question
Share on Google+
4 Replies

Expert 100+
P: 305

Good Luck
Jul 5 '10 #2

P: 284
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.
Jul 5 '10 #3

Expert 5K+
P: 8,434
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.
Jul 17 '10 #4

P: 284
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.
Jul 17 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.