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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATE-STAMP on SUB FORM ?

Status
Not open for further replies.

kinselas

IS-IT--Management
Aug 4, 2002
60
AU
I would like to place a Date Modified stamp on a sub form but just does not work.
1. I created a field on the table
2. opened the form in design mode and dragged the field onto the form.
IT DOES NOT WORK WHEN I AMEND A FIELD ON THE FORM.
Please help
 
Use the BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If NewRecord Then Exit Sub
Me("DateStampControl") = Now
End Sub


This will record the modification date and time for edits.
If you want to do it for new records as well, delete:

If NewRecord Then Exit Sub

Good luck
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
I think you need some code for this. For example we will call your date field dteTrans.

In the subform when the first record is entered we will update dteTrans to the current date.

To do this we use the beforeupdate event of the first field in the subform, in which data entry will occurr.

Me.dteTrans=Date()

However, as this value is not saved it may dissappear as you move about the form.

Alternatively you could set dteTrans default value to Date()

HTH
 

Hi:

There is a pretty slick procedure in this FAQ on this site:

faq181-74

Elizabeth shows how to date stamp a new or edited record and also capture the user ID.

Hope this helps. Gus Brunston [glasses] An old PICKer, using Access2000.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top