PDA

View Full Version : DTPicker control gets locked automatically on tab control



prashs
05-18-2010, 02:56 PM
Hi,

I am using MS Access 2003 with Visual Basic 6.5. I have a Tabbed control on a form. On one page of the form I have a Date Time picker control (DTPicker) configured to show time in 24-hour format (HH:mm). Now when I switch from one tab to another the format of the DtPicker control changes from the "HH:mm" format to the "mm/dd/yyyy" format. I couldn't find why this was happening but to counter this I added the following logic in the "TabCtl12_Change" event handler which is called every time I switch from one tab to another:

Me.Sign_In_HourIn2.CustomFormat = Format(Me.Sign_In_HourIn2.Value, "HH:mm")

Now, by doing this the proper value is shown in the proper format, but the control is locked somehow and I can't change the time value again. I have tried doing the following:

Me.Sign_In_HourIn1.Locked = False
Me.Sign_In_HourIn1.Enabled = True

But this doesn't help.

Does anybody have any suggestion as to what should be done here? Is there any other control that can be used instead of DTPicker.

Thanks!

OBP
05-22-2010, 05:27 AM
prashs, welcome to the forum.
It sounds like you have a conflict between the Tabs and the DTPicker, is the picker on the Mainform or one or more tabs?

prashs
05-22-2010, 06:14 AM
Thanks for the reply! The DtPicker is on one of the Tabs. What do you mean by "conflict"?

OBP
05-22-2010, 06:57 AM
Well, the fact that something changes the DTPicker when you move Tabs suggests that something on the other Tab is interfering with it.
Can you post a zipped copy of the database less any personal data for me to look at?