Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Date Time Picker Control: How Do Set The Displayed Date To Null?


I have a front end database form with date fields using the MS dtp control. The fields are unbound, but populated using a data class. The problem is that on many occasions the date field is Null, ie no data available. On display the dtp control always defaults to a set date, usually today (this is a property function of the control). What I can't seem to do is to display no date, or to delete the date displayed. Any thoughts would be very gratefully recieved. API perhaps?

I'm trying very hard not to have to write an Active-X control based on the dtp (mainly because of multilingual support and different localisation issues regarding dd/mm/yyyy (used by 90% of the world's population, and mm/dd/yyy - used by the remaining 10% in the US - sorry just had to get that jibe in for those of us who despair at having to go in to custom formatting in Excel simply to get dd/mm/yy )

Many thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Date Picker Control And Null
Hello
I am new with the date picker control. I would like to have one date picker control but the date for that field is not required. When information is entered about a product it could have a date or not. I don't see where you can just leave it blank on the date picker. It appears that you have to enter a date. Is there anyway that I can leave a blank space if no date is required for that product life?
Thanks
Kim

Updating Date Field With Null Value (date Picker)
Hello,

I am using VB and access. For date I am nsing date Picker. How can I update a date with null value?

I am using the code update the date field:

DateColumn=#" & Format(DTP1, "mm/dd/yyyy") & "#

When I try to udate the field with null value I receive error: syntex error in date in query expression '##'.
Please advice me how to update with null values.

Regards,
Elahi

Date Time Picker Control
Anyone have a good tutorial or something that shows you how to use the date time picker control? I am pretty new to VB and just screwing around but it seems like it should be alot easier than it is. I cant even figure out how to get started with this here.

Date And Time Picker Control In VB 6
HI how can i get onlt the TIme as value in Date and Time Picker control in VB 6? thanks

Date Time Picker Control
Hello everybody

I`ve been using the Date Time Picker control to let a user select a DATE. This control has also the word 'Time' in it. But I have found no way to let a user select the time.
Can this control be used to select 'Time' as well as 'Date' after all?

thx, in advance

George Papadopoulos

Date/Time Picker Control With XP Look
I searched allot for this, but it seems that no one has the solution.
The dtp control (Common Controls 6.0) looks the same under
2000 and XP even with the manifest file and code.

Is there no way to get the XP look on this control without
resorting to using a third party control (not allowed for project )?

Thanks in advance for any input on this?

Date Time Picker Control
I'd like to use this control to display date as well as to allow to enter it. If field doesn't have any date yet, this control displays todays date. Cannot find the way to clear it. I would prefere not to use any third party (like sheridan) controls. I also do not want to cover this control with something (like label or text box). Any help would be appreciated.
Vlad

Cannot Find Date/Time Picker Control
Hello,

On my VB6 program, I cannot find the MS Date/Time Picker Control.

I selected References -> Browse -> System32 folder -> MSCOMCT2.OCX -> Open. Then there was a Microsoft Windows Common Controls-2 6.0 checked. So I clicked OK.

Then I selected Components, a Microsoft Windows Common Control 6.0 (SP6) was already checked. I could not uncheck it because it was in used. When I also checked Microsoft Windows Common Controls-2 6.0, it popped up an error of Name conflicts with existing module, project, or object library.

What should I do? I just want to use the DateTimePicker.

Jeff

Microsoft Date And Time Picker Control
I dont have this control on my pc. Where can I download it from ?

Thanks in advance !


Date Time Picker >> Fuction To Calculate A Specific Date
I have two Date Time Picker controls.

What needs to happen is when user selects a date in DTPicker1 then a date 7 months later, on the following tuesday is displayed in DTPicker2.

Any help with this would be great.

Custom Format With Date/Time Picker Control
How do you get the date/time picker control to display time in a format such as 'h:mm ampm'? I have set the format of the control to custom and put the format in the CustomFormat property, but the ampm part dosen't seem to work properly. It looks like it is confusing the m's in 'ampm' with minutes. Is there a proper mask or escape character to do this?? Is it even possible at all? Any help is appreciated

Custom Format Date/time Picker Control
Hi Guys,

Im a newbie to the VB world, im trying to custom format the date time picker control so that it highlights/displays the monday of the current week.

Any help would be appreciated!

Commit Edit To Date Time Picker Control (RESOLVED)
Hello everybody

I have a Date Time picker control on my form. The problem is that, sometimes a user may choose to edit only the day and not the month. So after he/she edits the day, and without moving on to the month component, he/she can press a button on the toolbar which attempts to read the value of the Date Time Picker control. In such a case it seems that the day has not been updated. So the toolbar handler reads the previous value.
Is there a way to force the control to update the value, with the newly inputed data?

thx, in advance

George Papadopoulos

Date Picker Control Doesn't Show Current Date In Field
How do I set the display date in the Date Picker control field ? MSDN says that it should return the current date by default, but it only shows the current date highlighted in the drop down calendar.

The control shows the date when the control was created and added to the form.

How do I set the date at form load ?


Code:
dtpicker1.value = ? ' how do I call current date ?

Diplay No Date In The Date Time Picker
anyone know how to display no date or have the date time picker come up with no date in it when starting up a program. My program comes up with fields displayed but blank and disabled. I would like to use the time picker and have the field come up disabled and blank.

Any ideas??????

Date Time Picker
I need to have the year from the date time picker to be formatted as YY. Could someone help me with the syntax on doing this?

Also, Is this an efficient/logical way of doing this? I have 3 separate text boxes in which the user can either enter the date in or select it from the DTP form.

Private Sub dtpickerLbl_Click()
monthTxt.Text = dtpFrm.dtpCal.Month
dayTxt.Text = dtpFrm.dtpCal.Day
yearTxt.Text = Format(dtpickerFrm.dtpCal.Year, YY) ...This ain't working...
End Sub

Date Time Picker
Can the value of the date time picker be left blank? My reason for asking this is so that I can use this for entering Date of Birth and want to default it to blank.

Can someone help?

Date Time Picker
i am using a datetimepicker and want to put the value into a textbox...not sure what the property is to use though..

txttextbox.text=dtpDate.???

please help
thanx
trin

Date Time Picker
I am trying to use the date time picker control from the Common Controls-2 6.0 so a user can select a time and I can store that into a variable to then use that to do calculations.

I have set the format to dtpTime in properties but when I try to get a time from the control it still displays a date.

How do I get a time out of the date time picker?

Date Time Picker
hi folks i'm trying to use the datetimepicker object and i'm wondering how to leave an empty field so that the user will HAVE TO select a date? i don't want the user to possibly use the default date!

Date/time Picker
I have a form which users enter booking information,
including a date/time . I am trying to speed up this process
by allowing them to click (somehow) on a 'suggested time'.
I currently use a normal DTPicker object, but this is very slow
for some operators.
Included is my attempt at doing this. A form which is called up
from the main form etc....

Can anyone sugggest a better/easier/nicer or whatever way
of doing this???

Any help much appreciated....

Date Time Picker
I have problem while i try to update the value in the DTPicker

Code:
'Order Date
ls_Sql = "update ic_Order set Ord_Date = '" & DTPicker1 & "' "
ls_Sql = ls_Sql & "where "
ls_Sql = ls_Sql & "Ord_No = '" & Combo1.Text & "'"
gconn.BeginTrans
gconn.Execute (ls_Sql)

gconn.CommitTrans
MsgBox "Order Inforamtion has been modified"
Can someone pls help me

Date Time Picker
How to insert the date selected in a Date Time Picker into the mySQL database which has a default value of yyyy:mm:dd

Date Time Picker
Hello All,
I have a date Time Picker but the only issue I am having is that I am trying to validate that the user can not enter in a min time of 7:00 AM and no later than 8:00PM. This is what I have:


If Me.dtpTime.MinDate<=7AM Then
MessageBox.Show("Can Not Book Appointment Before 7 AM")

End If

Thanks in Advance for any help

Date Time Picker
WHere would I find the Date Time Picker control in VB6?

Date Time Picker
Has anyone found a good date time picker? I looked at some company's web sites and I didn't found any.

The maskedit control (VB6) is giving me a lot of problem and the date time picker from VB6 is not the control I need neither.

I'd need a date control that works well and is somehow flexible, just like in Access.

(Why the date time picker in vb6 HAS to be formatted that way? Long date, with 2 gaps... It's ugly no one wants to use this format!)

Thanks!

Date And Time Picker
I am creating an application that I want to use a calendar in. I found Date and Time picker in the help files but I cannot find any instructions on how to load it or where to find it.

Date And Time Picker
I am creating an application that I want to use a calendar in. I found Date and Time picker in the help files but I cannot find any instructions on how to load it or where to find it.

Date Time Picker
I got two question :

1. How I want to reset value in Date Time Picker?

2. How i want to display current date and time on the form beside display it using statusbar panel.

Date Time Picker In VB 6
Hi

I have a VB 6 program running on a Win XP machine.

As soon as the client opens a form with a date time picker, it gives a "Runtim Error 7 - Out of Memory" error.

I have looked throught the whole MSDN, etc. Don't find nothing.

Can someone please give me some advise. Rather urgent. Client not to happy.

Thanks.

Date Time Picker
Where can I find the Date Time Picker? I know its a new control within VB 6.0 but I just can't find it.


Thanks.

Date Time Picker
How can I detect the status of the Checkbox in the Date time Picker. I want the the font color to be black if the checkbox is selected. Not selected in the property page, but actualy selected on the control. If it is not selected I want the font colour to be the same as the background colour.

Date And Time Picker Bug
Hi!

I am using the Microsoft Date and Time Picker Control 6.0 (SP4) in Access' VBA.
In the Form_Current event I am setting the value of the Control by the value methode.
Sometimes I am getting the error code 2771. (Free Translated from germany: The bounded or unbouded objectfield which you edit contains no OLE-object.

Thanx for help

Date Time Picker In VB
Hi,

I was just wondering if anyone knows how to do a Date Time picker in Visual Basic as I dont know how to construct one as I am still really a beginner. Any help would be appreciated.

Cheers,

Tim

Date & Time Picker Bug?
I used the date and time picker control in my VB application and have notice something that occurs now and then. The format I am using now is as follows:
Mon Apr 09, 2001 01:41 PM

Sometimes when I increase the time using the arrows on the right side, the PM will skip from PM to AM when I have not rolled the time over.
For example: The time is 1:30 PM and you advance the time to 1:40, the PM will change to AM.

Has anyone else noticed this issue? Thanks.

Date Time Picker
Hello,

I want to handle DateTimePicker control with keyboard.
I changes its focus on Day to Month and to Year by using send keys command with Enter.
Problem is i want Lost Focus on the time when user Enter's Year.

How can i catch that in which position user enter's the entry ?


Thanks

Microsoft Date Time Picker Bug - Resizes Every Time I Open The Form !
Hi All,

I've created and published a custom form in Outlook 2000 which includes 5 DTpicker controls.

Every time I open a new item using this form, the controls resize to a very small size. Subsequently when I close the item (with or without saving any changeS) and open the form in design mode, the controls have stayed in the small size.

ANy ideas what is causing this behaviour and how to solve it? Any help would be greatly appreciated - the ap is ready for deployment and this is the only thing I am not able to solve !

Cheers,
Kaus

Microsoft Date Time Picker
Hello,

I have a problem with a form that I made in Excel 2000. Someone in our organization cannot use the form because they cannot see the Date Time Picker combobox that I put on the form. They were missing the mscomct2.ocx file. I added this file to their system 32 directory, but they still are unable to view the form.

Further, when I go into their toolbox and right-click to add more controls, the Microsoft Date Time Picker is still not an option.

Any ideas?

Mike

Date/Time Picker On New Form
How do I add a Date/Time Picker onto a new form using the VB editor in Excel?

Date And Time Picker Question....
I have a date and time picker on my form which seems to be in this format:
Thursday, August 31, 2006

I need to find a way to change it to this format:
8/12/2006 7:26:19 AM

I have looked but I can't seem to find how to make it this way.

Can anyone help me on this one?

Thank you!

Problem With Date Time Picker! Please Help
I use win2000 sp3 and VB6 sp5.
I try to load some date and time information to Date Time Picker control. My code works well on my computer, but on the other computers I have heard that not (one of them uses win2000 sp3 too).

I have two Date Time Picker controls on my form:
1) DTPicker1 - it is for showing time.
UpDown = True
CustomFormat = HH:mm:ss
Format = 3 - dtpCustom
DataFormat = Time 'the format is also HH:mm:ss
2) DTPicker2 - it is for showing date.
UpDown = False
CustomFormat = dd.MM.yyyy
Format = 3 - dtpCustom
DataFormat = Date 'the format is also dd.MM.yyyy

The code that causes an error (GetProfile is a function that loads a string from a ini file, "FileName" is a filename in my code, the first GetProfile(...) returns a string formatted like 02.03.3333 and the second GetProfile(...) returns a string formatted like 01:02:03):
DTPicker2.Value = Format(GetProfile("Message", "Clock2Date", Format(Date, "dd.mm.yyyy"), "FileName"), "dd.mm.yyyy")
DTPicker1.Value = Format(GetProfile("Message", "Clock2Time", Format(Time, "Hh:Nn:Ss"), "FileName"), "Hh:Nn:Ss")

I have also tryed this code, but it causes also an error (GetProfile functions return the same string as above):
Dim ClockDate As String, ClockTime As String
ClockDate = Format(GetProfile("Message", "Clock2Date", Format(Date, "dd.mm.yyyy"), "FileName"), "dd.mm.yyyy")
ClockTime = Format(GetProfile("Message", "Clock2Time", Format(Time, "Hh:Nn:Ss"), "FileName"), "Hh:Nn:Ss")
DTPicker2.Year = Format(ClockDate, "yyyy")
DTPicker2.Month = Format(ClockDate, "mm")
DTPicker2.Day = Format(ClockDate, "dd")
DTPicker1.Hour = Format(ClockTime, "Hh")
DTPicker1.Minute = Format(ClockTime, "Nn")
DTPicker1.Second = Format(ClockTime, "ss")

Will you be so kind and help me. It is very important to me. I have tryed to solve this problem many hours, but in vain.


Thank you!

Date Time Picker Problem
In the MSDN, there is a topic with the title
CustomFormat Property, Format Event, FormatSize Event Example


this is the code of the Example

Code:
Option Explicit

Option Base 1
Private sSpanishMonthLong(12) As String

Private Sub DTPicker1_Format(ByVal CallbackField As String, FormattedString As String)
If CallbackField = "XXXX" Then
FormattedString = sSpanishMonthLong(DTPicker1.Month)
End If
End Sub

Private Sub DTPicker1_FormatSize(ByVal CallbackField As String, Size As Integer)
Dim iMaxMonthLen As Integer, i As Integer

If CallbackField = "XXXX" Then
iMaxMonthLen = 0
For i = 1 To 12
If iMaxMonthLen < Len(sSpanishMonthLong(i)) Then
iMaxMonthLen = Len(sSpanishMonthLong(i))
End If
Next
End If
Size = iMaxMonthLen
End Sub

Private Sub Form_Load()
DTPicker1.CustomFormat = "MMMM(XXXX) dd, yyy"
DTPicker1.Format = dtpCustom

sSpanishMonthLong(1) = "Enero"
sSpanishMonthLong(2) = "Febrero"
sSpanishMonthLong(3) = "Marzo"
sSpanishMonthLong(4) = "Abril"
sSpanishMonthLong(5) = "Mayo"
sSpanishMonthLong(6) = "Junio"
sSpanishMonthLong(7) = "Julio"
sSpanishMonthLong(8) = "Agosto"
sSpanishMonthLong(9) = "Septiembre"
sSpanishMonthLong(10) = "Octubre"
sSpanishMonthLong(11) = "Noviembre"
sSpanishMonthLong(12) = "Diciembre"
End Sub


attached is a sample project with this code

the question is that: how can i change the callback filed ("XXXX") at run time using up and down arrows
It might be done using CallbackKeyDown Event, but how???
I tried this but failed

Code:
Private Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)
'Did NOT work
If CallbackField = "XXXX" Then
Select Case KeyCode
Case KeyCodeConstants.vbKeyUp
DTPicker1.Month = DTPicker1.Month + 1
Case KeyCodeConstants.vbKeyDown
DTPicker1.Month = DTPicker1.Month - 1
End Select
End If
End Sub


any suggestions?

Date Time Picker And NULLs
Hi guys, im facing a problem about dtpickers. It doesnt have an option to empty date. I have an access dbase and when the query is blank date it returns an error "cant accept null values"

yeah i know that error but there's no option to empty date within DTpicker control. At first im using a textbox controls for date, but that would be difficult for the user to input date and i am oblige for a date validation procedure for that.

Is there a work around with this? I find DT picker handy for entering date but it wont allow nulls from dbase.

Im going in circles explaining... hope you dont mind...

Date Time Picker Problem
Hello! I'm having problem with date time picker everytime I get the value of time of date time picker I also get todays date. How can I get only time it won't include todays date?

Date Time Picker Dropdown
I would like to know how to invoke a dropdown effect on a date
time picker control. I have tried sending a WM_LMOUSEDOWN
message, but it only invokes the mouse down event. I need it to
show the calendar like the user clicked on the dropdown.
I also tried sending the CB_SHOWDROPDOWN message, but nothing.

Any ideas??

Thanks in advance for any help.

Date Time Picker + Database
Hello all. I have a Access database which I read records from. All the
records read fine, except the Date/Time field of the database is not being
properly assigned to my Date-Time-Picker control in my VB code.

I've tried setting the datasource and fields with both code, and by using
the Adodc control (and setting the DTP control datasource, datafield, and
dataformat properties via the VB interface). All I get is an error 545
code, along with "Unable to bind with field or Datamember: 'Date Planted'

[Date Planted] is the correct field name, spelled exactly as it is in the
database. The database and table are opening fine, because I can read all
the other fields from the table.

I checked google.ca, I didn't see any useful mention of it there.


<Ade
--
Adrian Parker. Ordained priest. <adrian.parker@sympatico.ca>
Want to know the purpose of life? I'd be happy to share it with you...

Date Time Picker Conflict?
I am using a date time picker control, MCOMCTL2. Issue is that when I try to use the standard Format() function in VB in that same project, it only shows the arguments for Integer and upon looking at the help, it points me to the date time picker control.

How do I specify the Format function explicitly? I've tried using the object browser and searching help.

FormatDateTime() works okay but doesn't give me the customizing I need.

I've got both VB6 SP5 and just loaded SP6 but they don't help.

TIA

Date Time Picker...blank?
Is it possible to have a date time picker be blank until you put a date into it? If I can't do that, I guess I will just use a normal textbox. Will someone let me know? Thanks!

Brenda

Date Time Picker And Database
hi,
1) How can i set (initially) the value of a datetime picker control as blank?


2)in sql/server database i have a field with datatype smalldatetime.
can i enter a null value / blank date (no date) into this field from vb front end.
if possible how?


plz help
thanx
raj

Copyright © 2005-08 www.BigResource.com, All rights reserved