DatePicker Problem

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 4
Reputation: nareshkumar131 is an unknown quantity at this point 
Solved Threads: 0
nareshkumar131 nareshkumar131 is offline Offline
Newbie Poster

DatePicker Problem

 
0
  #1
Nov 1st, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,122
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 129
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic
 
0
  #2
Nov 2nd, 2009
you need to format the value of DTPicker.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 255
Reputation: AndreRet is an unknown quantity at this point 
Solved Threads: 37
AndreRet AndreRet is offline Offline
Posting Whiz in Training
 
0
  #3
Nov 2nd, 2009
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...
Please mark questions as answered when done.

Be the ONE!!!
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 476
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #4
Nov 2nd, 2009
some little change
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Text1.Text = dtPicker1.ValueText1.Text = Format(Text1.Text, "dd,mm,yy")
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 476
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #5
Nov 2nd, 2009
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.
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 255
Reputation: AndreRet is an unknown quantity at this point 
Solved Threads: 37
AndreRet AndreRet is offline Offline
Posting Whiz in Training
 
1
  #6
Nov 3rd, 2009
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.
Please mark questions as answered when done.

Be the ONE!!!
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC