Date Time Picker - Remove Time
I have a bunch of datetime pickers on my form.
When I step through my program using F8 I notice that when the dtPicker is not changed by the user it writes a value to the database such as "07/25/2005".
The problem I'm having is that when the user changes the date on the dtPicker it shows up in the program as "07/25/2005 9:40:45AM" which is not working because my database field is not a datetime.
How can I trim the time off the end?
Is there a property that does this or do I have to resort to something like a MID or LEFT function to get the values I want?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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
Date Time Picker - Custom Time Question
Hello,
I have a dateTime Picker on a form that is bound to a field in an Access Db. I have both the control and the field configured to handle UTC Time. That is, the control's .Format property is 3 -dtpCustom and the .CustomFormat is "HH:mm". Furthermore, the database field is set to Date/Time and the Format is set to ShortTime. This seems to work fine, because the Db field is storing the correct time.
However, when I try to pass dtPicker.Value to a variable with the Date data type, it's not showing the correct time when the original time was above 12:59. For example, 19:06 in the dtPicker stores 19:06 in the Db, but it's storing 07:06 in a variable of Date type.
Am I missing something?!?
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
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
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
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 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!
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.
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 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 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
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
How To Make Usercontrol Like Date/time Picker
Guys,
How do I create a 'popup' like a combobox or date/time picker? When you press a button a small 'window' (or popup, whatever you like to call it) appears with controls on it. Can someobody point me in the right direction?
Thanx in advance
Excluding Holidays In Date And Time Picker
I have an Access 2000 database that has a couple DTPickers on a form. On the DTPickers, I don't want the user to be able to pick the statutory holidays, Christmas, Easter, Thanksgiving, etc.
Is there any way that this can be done? Is there a way to make certain dates not active or available on the DTPicker. Any help would be appreciated.
Thanks
Update Date Time Picker On Open
How do I change the value of a Date Time Picker on a custom form to the current date when I open the spreadsheet.
The code UserForm1.DTPicker1.Value = Date does not work
Thanx
Auto Reference Date Time Picker
Timbo, thanks for your previous help with this!
Can anyone help? I just can't get the code to work - what am I missing? vb keeps rejecting any of the lines that contain my file path I have tried putting it in quotes and all sorts - I am sorry as I am very inexperienced with this - here is Timbos original code with my file paths:
Private Function References_Manage(blnAdd As Boolean, C:WindowsSystem32 mscomctl.ocx$)
Dim refReference As Reference
Dim strTitle$
On Error Goto Error
References_Manage = False
With ActiveWorkbook.VBProject
Select Case blnAdd
Case True
.References.AddFromFile C:WindowsSystem32 mscomctl.ocx$
References_Manage = True
Case Else
For Each refReference In .References
If UCase(refReference.FullPath) = UCase(C:WindowsSystem32 mscomctl.ocx$) Then
.References.Remove refReference
References_Manage = True
Exit For
End If
Next refReference
End Select
End With
Finish:
On Error Resume Next
Set refReference = Nothing
Exit Function
Error:
Resume Finish
End Function
Date / Time Picker Binded To An ADO Connection??
Hi can anyone help me out here. I have a Date / time picker on my form, and was wondering if I can use a ADO connection to bind it to my database.
I gave it a shot, but it says unable to bind to datafield of datamember.
Has anyone tried this before??
thx
Date/time Picker ..database Problem
hello guys i'm here again with another problem i hope you could help me
i'm working in a VB6 app with an Access database......in one of the forms i'm using two date/time pickers to catch from the user one date "Fromdate" and other for the "todate"...i use these dates to search in the database in a range of dates in the fields begindate and enddate .......my problem is that when i try to search a date after 12/31/00 with date format mm/dd/yy the search code don't found a record ......the code don't found dates such as 05/20/01 ........... and those dates exist in the database
i checked the format in my database in those fields and is the same mm/dd/yy
This is the code to format de dates from the date/time pickers
Dim bdate As Date
Dim Edate As Date
bdate = Format(dtbegin.Value, "mm/dd/yy")
Edate = Format(dtfinish.Value, "mm/dd/yy")
This is the code in the search button
sql = "SELECT * FROM INFORMA WHERE begindate > #" & bdate & "# AND endate < #" & Edate & "# "
Set Mirecord = New ADODB.Recordset
Mirecord.Open sql, Miconexion, adOpenDynamic, adLockOptimistic
i think that maybe the problems is in the format of the dates from the date/time pickers......but i tried to change it but i can't......thanks in advanced guys
Disable Days In Date/Time Picker
I have a DateTime picker on my form, and in certain instances I want to make sure that the end user picks a certain day of the week. I did have it working so that a MsgBox would pop up and prompt them to change the day, but it would be easier if I could just lock out the other days in advance.
Basically, the end user has to select the same day of the week as is already displayed elsewhere in a monthview control.
|