Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 29th, 2007, 03:20 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default Insert System date and System Time -Form _TextBox


ANY BODY HELP ME!!!!!!

   I HAVE A PROJECT AND IN A FORM I HAVE THREE TEXT BOXES.ONE FOR THE CUSTOMER NUMBER,ANOTHER FOR DATE,TIME.CUSTOMER NUMBER WILL BE INSERTED AUTOMATICALLY.BUT I WANT THE DATE AND TIME TO BE THAT OF THE SYSTEM DATE AND TIME.WHAT CODE SHOULD I USE IT TO ACCOMPLISH IT?
THIS PROJECT IS AN URGENT ONE.SO I HAVE TO COMPLETE IT TODAY ITSELF.SO,PLEASE HELP ME URGENTLY........
     NANDA KUMAR
  kumarc_n@yahoo.com

Reply With Quote
  #2 (permalink)  
Old January 29th, 2007, 04:25 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
you could try Date & Time. do you have the code that inserts customer nu mber automatically?

vbscript
text box
MsgBox CStr(Date)

or to a log file
objFile.WriteLine Date


Reply With Quote
  #3 (permalink)  
Old January 29th, 2007, 04:46 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default

No.I have connected it to the Database.Thanks.

Do you have the code for the insertion of Date and Time into two text boxes...If yes, then please give.I will be very thankful to you..

Reply With Quote
  #4 (permalink)  
Old January 29th, 2007, 05:28 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default

GIve me a reply anybody.....pls

Reply With Quote
  #5 (permalink)  
Old January 29th, 2007, 06:16 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default


' Displays the date
Me.TextBox1.Text = DateTime.Now.ToShortDateString

' Displays the time
me.textbox1.text = datetime.now.ToShortTimeString

Reply With Quote
  #6 (permalink)  
Old January 29th, 2007, 07:15 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default


Will the below code work? I tried it, but not coming properly.







Quote:
quote:Originally posted by HaveHave2222


' Displays the date
Me.TextBox1.Text = DateTime.Now.ToShortDateString

' Displays the time
me.textbox1.text = datetime.now.ToShortTimeString

Reply With Quote
  #7 (permalink)  
Old January 29th, 2007, 08:36 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which version of Visual Basic do you use?

Tested with version 2005.net, works fine?!

Reply With Quote
  #8 (permalink)  
Old January 29th, 2007, 10:26 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default


I am working with VB Version 6.

 Nanda Kumar

Quote:
quote:Originally posted by HaveHave2222
 Which version of Visual Basic do you use?

Tested with version 2005.net, works fine?!

Reply With Quote
  #9 (permalink)  
Old January 30th, 2007, 01:00 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In vb6.0 use this (any one, which you need)
MsgBox FormatDateTime(Now, vbShortDate)
MsgBox FormatDateTime(Now, vbGeneralDate)
MsgBox FormatDateTime(Now, vbLongDate)
MsgBox FormatDateTime(Now, vbLongTime)
MsgBox FormatDateTime(Now, vbShortTime)

To use just system date
msgbox Date

when you need, just the system date to be inserted,
dim s as string
s = cstr(date)
use s in your insert sql statement by concatenating it in the proper field place.

hope this helps.

With Regards,
Raghavendra Mudugal
Reply With Quote
  #10 (permalink)  
Old February 13th, 2007, 06:38 AM
Authorized User
 
Join Date: Jan 2007
Location: TRIVANDRUM, KERALA, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cnkumar74 Send a message via Yahoo to cnkumar74
Default

Thankz.

How can we get back the datas written into the DB,into a form?
I was unable to do it.How can we create a Pop-up Calendar in VB?




Nanda Kumar

Quote:
quote:Originally posted by Raghavendra_Mudugal
 In vb6.0 use this (any one, which you need)
MsgBox FormatDateTime(Now, vbShortDate)
MsgBox FormatDateTime(Now, vbGeneralDate)
MsgBox FormatDateTime(Now, vbLongDate)
MsgBox FormatDateTime(Now, vbLongTime)
MsgBox FormatDateTime(Now, vbShortTime)

To use just system date
msgbox Date

when you need, just the system date to be inserted,
dim s as string
s = cstr(date)
use s in your insert sql statement by concatenating it in the proper field place.

hope this helps.

With Regards,
Raghavendra Mudugal
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting system time angelboy C# 2005 1 May 4th, 2007 08:05 PM
How can I set system time & date in VB.net ? mike123abc Pro VB.NET 2002/2003 1 April 27th, 2007 10:00 AM
HOW CAN SYSTEM DATE N TIME BE CAPTURED IN A TXTBOX cnkumar74 VB Databases Basics 6 February 14th, 2007 02:09 AM
System Lockup time vincent737 C# 0 July 21st, 2005 05:58 AM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM



All times are GMT -4. The time now is 09:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.