Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting current time when adding a new record 2

Status
Not open for further replies.

Luongo1

Programmer
Oct 13, 2006
52
CA
Hi, I'm using the Time() function as the default value in one of my access fields. Currently, when the user enters a record in datasheet mode, the next row appears with the time at that point. However, in most cases, that row will be added several minutes later, meaning the user will have to update it every time. Is there a way to make it so that the time updates itself when the user modifies any field in that row? Thanks...
 
In the BeforeUpdate event procedure of the form:
Me![yourTimeStamp control] = Now

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for replying PHV. The user will not be using a form, however. The data will simply be inputted in datasheet mode. Would this still work, and if so, what would I use to call the BeforeUpdate sub - the table name?

Also, is there a way to automatically open a specific table when the database is opened, rather than having to select it? Thanks again...
 
Never ever let a user play directly with a table !

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV is correct. Tables are for data storage not data entry! Use the Form's Wizard and make a form and under LAYOUT choose Datasheet. It'll look the same, but you'll be able to control things better.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks guys, I wasn't aware you could make the form look just like the datasheet. BeforeUpdate function's working great...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top