Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,179 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,002 people online right now. Registration is fast and FREE... Join Now!




adding a real time date as an entry to the database

 
Reply to this topicStart new topic

adding a real time date as an entry to the database

emkaye
23 Aug, 2007 - 09:11 AM
Post #1

D.I.C Head
**

Joined: 12 Aug, 2007
Posts: 54


My Contributions
I am creating a time monitoring system that will record the time spent in working of the employees as well as the dates they went to work.

This is a REAL TIME monitoring system. First, I just want to know if my code for displaying the time in the form is correct.

CODE

Label7.Caption = "" & Time


My problem is, it only displays the time when I begin to run my VB program, nothing happens next. I have seen some VB programs having a real time displayed, the time is running BUT with my VB program, the time is not running it's just stucked up there.

Do I need some other codes?

Thanks.. smile.gif


User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Adding A Real Time Date As An Entry To The Database
23 Aug, 2007 - 11:18 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
You need to use a TimerControl, then in the Timer1_Click event change the time, set the interval to 1 second
User is offlineProfile CardPM
+Quote Post

emkaye
RE: Adding A Real Time Date As An Entry To The Database
26 Aug, 2007 - 08:12 AM
Post #3

D.I.C Head
**

Joined: 12 Aug, 2007
Posts: 54


My Contributions
Uhm...I did some codes that differ from the one that you gave.I did the following:

CODE

Private Sub Form_Load()
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
txtDateTime.Text = Now
End Sub


It worked...and there's nothing wrong with it. BUT I still want to know what is the difference if I have set the interval to 1000 instead of 1(which you told me to do)?

By the way, my user login system already worked. Thanks for the help! smile.gif And I also would like to thank you for being patient and understanding for "beginners" like me.

Thanks and God bless! biggrin.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Adding A Real Time Date As An Entry To The Database
26 Aug, 2007 - 08:43 AM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
The interval of the timer control is set at milliseconds, so 1000 = 1 second smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 01:04AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month