Google Answers Logo
View Question
Q: Time stamp a field ( Answered 5 out of 5 stars,   1 Comment )
Subject: Time stamp a field
Category: Computers > Programming
Asked by: jstm-ga
List Price: $10.00
Posted: 04 Mar 2005 23:28 PST
Expires: 04 Apr 2005 00:28 PDT
Question ID: 485028
When I scan a badge number into txtbox1 I would like txtbox2 to be
datestamped. How do I make txtbox2 show the date and time when txtbox1
is changed?

Request for Question Clarification by hammer-ga on 05 Mar 2005 05:23 PST
What program or programming language are you using? 

- Hammer
Subject: Re: Time stamp a field
Answered By: hammer-ga on 05 Mar 2005 07:32 PST
Rated:5 out of 5 stars

I see by your other questions that you are using VB6.

The Textbox can respond to a Change event. This runs whenever the data
in the textbox is changed.

Double-click on the textbox on your form design. A code window will
appear. If it is not already selected, choose Change from the
right-hand dropdown. The code will look like this:

Private Sub txtbox1_Change()

    txtbox2 = Now()

End Sub

Now is a built in function that returns the current date and time.

- Hammer
jstm-ga rated this answer:5 out of 5 stars

Subject: Re: Time stamp a field
From: xarqi-ga on 05 Mar 2005 03:05 PST
I think you'll need to suppky more information about your software
development system before you can get specific help.

Generically, it should be simple.
Presumably, there is a mechanism for triggering an event of some sort
when the value of the first field changes.  Trap that event and within
the handler, put the current system time into the second field.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy