944,091 Members | Top Members by Rank

Ad:
Nov 1st, 2009
0

DatePicker Problem

Expand Post »
Hello,
I have a DatePicker and text box on my Form and When I try to show the choosen date of DatePicker in the TextBox. It Shows the date and time. But I want to show only date. Plz help me.

Code:
text1.text=DatePicker1.value
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nareshkumar131 is offline Offline
4 posts
since Oct 2009
Nov 2nd, 2009
0
Re: DatePicker Problem
you need to format the value of DTPicker.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Nov 2nd, 2009
0
Re: DatePicker Problem
try and use something like -

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Text1.Text = dtPicker1,Value
  2. Text1.Text = Format(Text1.Text, "dd,mm,yy")

Hope this helps...
Reputation Points: 329
Solved Threads: 347
Senior Poster
AndreRet is offline Offline
3,700 posts
since Jan 2008
Nov 2nd, 2009
0
Re: DatePicker Problem
some little change
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Text1.Text = dtPicker1.ValueText1.Text = Format(Text1.Text, "dd,mm,yy")
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Nov 2nd, 2009
0
Re: DatePicker Problem
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Text1.Text = dtPicker1.Value
  2. Text1.Text = Format(Text1.Text, "dd,mm,yy")
Last edited by abu taher; Nov 2nd, 2009 at 10:57 pm.
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Nov 3rd, 2009
1
Re: DatePicker Problem
Must have been the wine.... comma in place of point. LOL

Some more dtPicker help for you all -

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub DTPicker1_Click()
  2. Text1.Text = DTPicker1.Value 'To get the date
  3. Text2.Text = DTPicker1.Day 'To get the Day
  4. Text3.Text = DTPicker1.Month 'To get the Month
  5. Text4.Text = DTPicker1.Year ' To get the Year
  6. Text5.Text = DTPicker1.DayOfWeek ' To get the Day of the Week
  7. Text6.Text = Format(DTPicker1.Value, "DD-MM-YYYY", vbSunday,
  8. vbFirstFullWeek) 'To set the date format as required
  9. Text7.Text = DateAdd("d", 10, "01/02/2001") ' To add 10 days to the given date
  10. Text8.Text = DateAdd("m", 10, "01/02/2001") 'To add 10 months to the given date
  11. Text9.Text = DateAdd("yyyy", 10, "01/02/2001") 'To add 10 years to the given date
  12. Text10.Text = DateDiff("d", "01/05/2001", "01/30/2001") 'To find the
  13. number of days between any two dates
  14. End Sub

Hope this clears some questions.
Reputation Points: 329
Solved Threads: 347
Senior Poster
AndreRet is offline Offline
3,700 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: A little help on a card game is needed
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: code need





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC