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

Default Date Of Datepicker.

How to set the defaut date shown in date-picker to the current system date? Right now it shows the date on which the control was created..

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
I Need A DatePicker Control That Will Handle Nulls And Default Date
I've have a really good look around for a decent DatePicker (about 3 days of testing) but can't seem to locate one which will not only display blanks when null but one which will ALSO default to todays date on drop down.

CCRP does NOT work like I have discribed.

I've already tried the label/textbox over the control but I've just got too many DatePicker controls to have to double up.

Anyone have a control they know will do this?

DatePicker - Unchecked By Default

I'm using DatePicker control with CheckBox property set to true. How can I set that the check box would be unchecked when the form is shown?
I need this because the user is not required to enter date and the only way the date is not set is by not checking the check box.


Default DatePicker Control To Be Blank
Can I do this ? Rather than having it default to the current date.

Help With DatePicker Date
I need help with this:

I set my DatePicker.value to "Now"
This is partially what I want. This works against one or two other features.

What I want is to have the calendar jump to "now" when it tops down on activation.

What property can I use to do that?

DatePicker - Min Max Date

I am trying to set min and max value to the datepicker, but it takes only the value that was set last. ie., either min date or max date gets set depending which was set last.

Code I am using:

dtpicker1.MaxDate = DateAdd("yyyy", 1, Date)
dtpicker1.MinDate = DateAdd("yyyy", -5, Date)

datepicker takes only the min date in the above case.

Please let me know the solution for the above.

Thanks in advance.

Date Comparison Between SQL Query And DatePicker
Hi guys. I've got a problem with comparing a date from a database with a date displayed in a date time picker using a an sql query.

This is the sql query with the concerned date issue.

 sqlSearchCourier = sqlSearchCourier & " AND Date = #" & dtpFirstDateCourier.Value & "# "

Now, my problem. In the database, a sample value of the date is "15/2/2003". Now when that value is also in the datepicker, it doesn't find a match. But when I put "2/15/2003" in the datepicker, it finds the match.

I understand that this is because of the difference between US and Australian date formats. So how do I get it to recognize the Australian format?


Setting DatePicker So No Dates Previous To System Date Are Accessible
My subject says it all really, im trying to set the datepicker so that users are not allowed to see dates prior to the system date my application is not concerned with previous dates. Any one helplease

Date Conversion As Oracle Database Date Default Format
Select sysdate from dual ; //oracle database
The result is : 28-AUG-04

How to convert “date” in vb to the above format?

Using below statement :
FormatDateTime(Date, vbLongDate) // Saturday, August 28, 2004

Then, combine with string functions (such as instr, left, mid, etc) can be achieved the desired result.

Any shortcut than above mentioned?


Default Value For Date
I am uisng VB 6.0. I connecting my VB application to SQL server. The issue I have is the default date i get is
1900:01:01 00:00:00.000.

If I dont add any values for the date textbox in VB then in SQL i get the above date. Is there a way I have nothing or null when the date is not added by the user.

Also How can i tell the user to use a particular date format in VB 6.0.

Help appreciated

Default Date Value
I have a class that has a date variable as one of its properties

i have a sub in this class called clear which basically clears the contents saved in these variables. so strings are set to "" objects are renewed by reseting them using New and integers/longs are set to 0. What would be the proper way to reinitialize the date? by setting it to "12/30/1899 12:00:00 AM" ?

Monthview Default Date.
Hi I am working on the Monthview control. How can I get its upper Caption to always show the current Month and date upon form load. Thanks

SQL Database Date Default
Hi folks! I am just starting to learn SQL server 7.0 and have one question (with probably many to come): how do you set a column's default value to the current date? In Access all i had to do was enter Now() in the default column, but SQL 7.0 doesn't seem to like that...

Using Default Function Date

I want to capture the last two digits of the current year e.g. 2005 would be 05 in my system.

At the moment i've coded this as follows..

variableX = Mid(Date,9,2)

This is because Date (on my system) is returned as dd/mm/yyyy. My question is this... does Date always return in this format? Or is this because of a setting on my system? I don't want to distribute the code then find it's trying to use this code to cut down 1st January 2005 or something in a different format.

The help file doesn't mention return formats.


MySQL Default Date
How do you set a default date field in MySQL.
I have to always specify the date when inserting a new record, when it's not needed.

Your can just use Now() as the default value in Access, what's the default for MySQL?


Default Date Picker Check Box Value
Hi team

The date picker check box appears to default to checked. How can I make it default to unchecked?



Smtp. The Sent Date In Reply Is An Odd Default
The headers are formatted properly. All the info is according to code, except when reply is clicked. The sent date is coming back as

-----Original Message-----
From: Ed Vogel []
Sent: Friday, July 10, 2893 6:44 PM
To: Ed Vogel
Subject: Information you requested - Diagnostics

Could this be a default setting on our mail sever?
Am I missing a value to be passed to the mailer?
I have hit a wall. Do anyone have an ice pack?

Geting The System Default Date From The API
Hi team!

I need to check that the user of my app has not changed the default date format on their PC. I know you can do this with the API, but can't find out how. Anyone know?

Assign A Default Value To A Date Control

I have a form that adds records to a access table. It contain fields like name, teacher name, exam dates and times. Is there a way to assign a default value to a date or time control? What I want to do is have the ability to leave the field blank if I don't have the date and time when I add the record to table. If I leave it blank I get a type mismatch error. Any suggestions?


Date Problem With Default Behavior
I have a user control and it has some date controls. Once user enters some data, and make a search, this data will be refreshed to the object. From the object I generate find query, execute, load the records and refresh the controls with the data.

I have a small problem with date fields, If don;t select any date, then the date in the object takes the default date "12/30/1899" and executes the query.

How do I work around this problem? thanks

Problem With Date That Ocassionally Default To 01/01/1901

I have a form that asks the user 'Is this the correct manufacture
date'...this form takes the system date as default but
ocassionally the form has started to display 01/01/1901....

The back end of my app. is an SQL Db
Does anyone have any ideas as to why this may be happening??

Your help is greatly appreciated!!


Create Date/Time Field And Loading Default Value
I am trying to add some fields programmatically to a database using DAO. I need to load some default value to the date/time fields in order that they ar not null. Here is what I tried:

xs = ""
On Error Resume Next
xs = db.TableDefs("Department").Fields("begHH").Name
On Error GoTo 0
If xs <> "reciprocal" Then
db.TableDefs("Department").Fields.Append _
db.TableDefs("Department").CreateField("begHH", dbDate / Time)
db.TableDefs("Department").Fields("begHH").DefaultValue = "12:00 AM"
'db.Execute "UPDATE Department SET begHH= "12:00 AM" WHERE
begHH IS NULL", dbFailOnError
End If

It does not like the string of "12:00 AM" at all. Does anyone know what value I should put in the newly created fields. Thanks fo rthe help.

Default Date Problem With VB Object And SQL Server Database
I am working on VB 6 and SQL Server 7.

I have an object with different data types and one among is date type. I have a stored procedure with all fields as parameters to update a table. The problem is if I don't set any date to my date variable in the object while saving, it is inserting 01/01/1900 as date. I think it is the default date in VB. If I don't set date, I should only insert NULL value to the database. What are the alternatives.

Its weird when I check the following code
Dim tDate as Date
debug.print isNull(tDate) --> this always return false

Display The Windows Default Short Date Format
Is there an easy way to just display the windows default Short Date format? eg. "mm/dd/yyyy" instead of "07/16/2003"

Changing Default Select Part Of Date Time Picker
Hi there,

I have been using VB for many many a year new and I seem to have come across a very strange problem

This is my problem.

I am using a date/time picker on a form. When it first get focus the day figures are highlighted, cursor keys allow the user to go to month and year etc...

Problem it seem to remember the last selected section. So if the user was on the month, the next time they go on the the date/timer picker the month figures are highlighed. I need the date/timer picker to allows be back on the day figure when it get focus...

I hope you understand what I mean

I hope someone can help...

Set DatePicker To Now
I want to set the datepicker (DTP) to today.
I know how to work with :
ShortDateFormat or something ( I can figure that out)

But I want the following:
I want the default setting of my DatePickers to Now (in ShortDate)-or is it vbNow?
I can do this by setting the value of DTP to vbNow in a form_load or a reset function.

But can you set it via a DTP property? (I couldn't find this , bu t hat doesn't mean it doens't exist)

Need Help With DatePicker AND I Need It BAD
I formatted my date to:
CustomFormat : dd-MM-yyyy (I believe the mm = minutes)
DataFormat : date (dd-MM-yyyy)
format : dtpShortDate

This is what happens:

I edit a date. say date1 :It is saved as 8-2-2005 (dd-MM-yyyy)
I can open de database and see it written as: 8-2-2005

Then I edit another date (date 2), if I now open the database, date1 is written as 2/8/2005 (MM/dd/yyyy) and date2 is: 8-2-2005

I thought fomatting "manually" in VB circumvents the date format of the
local OS

BUT the local OS date format: dd-MM-yyyy


Is there a tutorial out here somewhere that will show how to use the DatePicker?, specifically searching for records in a date range. Thanks in advance.

Some Q's About DatePicker
Hello ppl,
I've been wrestling with this datepicker for sometime now, and have come to the conclusion that I am not using this control in the way I need to. Some questions, I have two dtMonth controls, where the user selects a date from dtMonth1 and dtMonth2, thus creating a range to search between.
1) Should the SQL statement be in the Form Load, or in the second dtPicker_Click event?
2). Would it be easier to create a function that holds the SQL, and then call that function from the dtPicker_Click event.
3) Does Arnold Swarzenegger really think he can change the governmental landscape of California's debt ridden infrastructure?


DatePicker Value
Good day to all!

Just a question about datepicker. I have a datepicker DateFrom and DateTo, I want to output into a textfile the value (e.g. 20063107 to 20060208) of DateFrom and DateTo which the user click/chose. Someone please help. Thanks.


I must be either mentally insane or blind but I can seem to find the DatePicker control. I have searched these forms and discovered its in the Windows Common Controls 6.0 which I have but I can seem to find the control in the toolbox.

What am I doing wrong?

Here are the references I currently have in my project.
Microsoft Common Dialog Controls 6.0 (SP3)
Microsoft Windows Common Controls 6.0 (SP4)
Microsoft Data Bound Grid Control 5.0 (SP3)
Microsoft Tabbed Dialog Control 6.0 (SP5)

I have a Datepicker in my VB6 form.upon clicking on yes,i want to send the value of the datepicker to the Date field inside a table.

I wrote:Rs!PDate=DTPicker.value

so the field PDate is filled with both the date and the time.6/8/2006 2:46:49 PM,I want only the date to be displayed and not the time.

how can I do i?

Using Datepicker
i have an access database with a field birthday as short date,
i want to bound it to the adodc control, i want the datepicker to show the date in the database and like wise when thye user clicks on the datpicker the value gets added to the database...
it doesn't work when i set the adodc properties datasource=adodc, design mode
do i have to write code for this ...can someone hlp me...i'm thinking the code should go in adodc1_MoveComplete(......)

How To Use Datepicker
Can any one of give me suggestions

How To Use Datepicker
I wish to use the date picker.
How to use it and get the time and date in the text box

DatePicker In XP
Hey all,

I'm havving some trouble with the DataPicker control in Excel VBA, my app works fine under NT4 but when i load the form with the control it comes up with the following run-time error '459' "Can't move focus to the control beacuse it is invisable, not enabled or a type that does not accept the focus"

Can any one help with this...?

I've taken out the control and the refrerences in the project and all works fine.....

Would you know what is causing this error msg...... or what might the resolve be...?

Any help will be great.



Hi guys i was wondering if you could help me

I want to do this

When a user clicks on any DatePicker on my form i want the starting value to be todays date.

I have about 10 datePickers on the form (Form1)


In this picture you see a datepicker that is set to
01.02.2002. The second one is set to 28.02.2002.

If someone selects a date that "from" datepicker
that is higher than the date in the "to" datepicker,
the date in the "from" datepicker is set back to its
last date.

Now I want to close that calendar tab also when the
date is set back.

Any ideas?


Datepicker Help

I am using datepicker on my form to do scheduling......

Can I show some particular dates as highlighted if all the scheduling on those days is full??


Hi Everyone,

How do I put this into an array? I know the way I have tried this is neither the easiest nor the most efficient. I am trying to subtract 5 days from whatever day is choosen from the DatePicker, and if the new date lands on a Saturday or Sunday then the date is rolled back to the closest non weekend date. This part works ok. The part I need help on is with rolling back on a Holiday. So far I have tried to add 2 holidays and am not sure how to place these into an array so that if the new date lands on one of these days then it will be rolled back to a non holiday date. The two dates I have added so far are #1/1/2001# and #7/4/2001#. I would appreciate any help. Thank you.

Private Sub Command1_Click()
Dim NewDate As Date

NewDate = DateAdd("d", -5, DTPicker1.Value)

Do While Format(NewDate, "w") = vbSaturday Or Format(NewDate, "w") = vbSunday
NewDate = DateAdd("d", -1, NewDate)

If Format(NewDate, "w") = #1/1/2001# Then
NewDate = DateAdd("d", -1, NewDate)

ElseIf Format(NewDate, "w") = #7/4/2001# Then
NewDate = DateAdd("d", -1, NewDate)
End If

MsgBox NewDate
End Sub

In a datePicker, can I disable all day that are not monday....


In a datePicker, can I disable all day that are not monday....


How To Add Datepicker In Vb 6?
how to add datepicker in vb 6?

Where can i find the date picker? How do i put it in my form?

Abt DatePicker
I want 2 use two DatePickers in my application and want 2 retrieve the values of the two datepickers in the same form How?

VB DatePicker
How can I set DatePicker's format to DD/MM/YYYY?

Can anyone tell me how to set null value or "" to a datepicker control. (without using the checked property )

Thanks in advance

Customizing DatePicker

How do you customize the datepicker component such that it displays the date and time at the same time....


DatePicker And Flexgrid
I have a form which have on it a flexgrid and a datepicker, I would like a help with if I clicked on a date in the date picker it goes to the db and check if this date is avaliable and show its data on the flexgrid.

I tried many ways but it didn't work, if you could help with that

Private Sub DTPicker1_Change()

Screen.MousePointer = vbHourglass
rstelmainlog.Open "Select user_info.user_full_name,, log_main_data.call_type, log_main_data.call_station, log_main_data.call_ext, " _
& "log_main_data.call_line_used, log_main_data.call_date, log_main_data.call_time_started, " _
& "log_main_data.call_duration,log_main_data.called_number, log_main_data.call_personal,log_main_data.call_costcode From log_main_data, user_info Where user_info.user_ext = log_main_data.call_ext and <where condition for datepicker>, Cnxn, adOpenKeyset, adLockOptimistic, adCmdText"
mfgList.Rows = 1
If rstelmainlog.RecordCount <> 0 Then
Do While rstelmainlog.EOF = False

mfgList.AddItem rstelmainlog!id & vbTab & rstelmainlog!User_full_name & vbTab & rstelmainlog!Call_date & vbTab & rstelmainlog!call_time_started & vbTab & rstelmainlog!call_duration & vbTab & rstelmainlog!called_number & vbTab & rstelmainlog!Call_personal & vbTab & rstelmainlog!call_costcode
End If
Screen.MousePointer = vbDefault

The above is my piece of code for datepicker but I don't know what to put in the where clause withen the select statement to give me the result correctly.

Thanks again.

DatePicker Tool?
I can't seem to find this control in the components dialog to add it to my project. Anyone know where it is??


The statement below is True.
The statement above is False.

Copyright © 2005-08, All rights reserved