Particular for dtpicker


Private Sub DTPicker1_Click()
Text1.Text = DTPicker1.Value ‘To get the date
Text2.Text = DTPicker1.Day ‘To get the Day
Text3.Text = DTPicker1.Month ‘To get the Month
Text4.Text = DTPicker1.Year ‘ To get the Year
Text5.Text = DTPicker1.DayOfWeek ‘ To get the Day of the Week
Text6.Text = Format(DTPicker1.Value, “DD-MM-YYYY”, vbSunday, vbFirstFullWeek) ‘To set the date format as required
Text7.Text = DateAdd(“d”, 10, “01/02/2001”) ‘ To add 10 days to the given date
Text8.Text = DateAdd(“m”, 10, “01/02/2001”) ‘To add 10 months to the given date
Text9.Text = DateAdd(“yyyy”, 10, “01/02/2001”) ‘To add 10 years to the given date
Text10.Text = DateDiff(“d”, “01/05/2001”, “01/30/2001”) ‘To find the number of days between any two dates
End Sub

3 responses to “Particular for dtpicker

  1. NICE CODING, BUT THERE IS MISSING TO FIND OUT THE WEEK OF ANY YEAR AND HOW TO ADD ONE WEEK IN A PARTICULAR DAY.

  2. If I created 2 DTPicker and I want to minus it.
    So 3 – 1 = 2 (DTPicker1 – DTPicker2 = Total Date)
    The question: How can I do the coding.
    Help me please

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s