A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date of Edit



 
 
Thread Tools Display Modes
  #1  
Old September 23rd, 2004, 05:37 AM
Claire
external usenet poster
 
Posts: n/a
Default Date of Edit

Hi:

On my query, I need to have a field that shows the date that a record was
updated, however, the date can not change until the record is changed. I was
thinking that I can use the Date() function for this but I'm not sure how to
make it update with changes.

A solution would be awesome.

Thanks in advance.
Claire


  #2  
Old September 23rd, 2004, 06:37 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Wed, 22 Sep 2004 22:37:25 -0600, "Claire"
wrote:

Hi:

On my query, I need to have a field that shows the date that a record was
updated, however, the date can not change until the record is changed. I was
thinking that I can use the Date() function for this but I'm not sure how to
make it update with changes.

A solution would be awesome.

Thanks in advance.
Claire


You will need to do all your updating using a Form to accomplish this:
table datasheets have no useful events. You might need to implement
security (or draconian punishments, or both) to prevent people from
going around the form and editing data in a table or query datasheet.

Put a date/time field (let's call it Timestamp) in the table and
include it in the Form's recordsource query.

In the Form's BeforeUpdate event put

Private Sub Form_BeforeUpdate(Cancel as Integer)
any form validation code goes here
if the data passes...
Me![Timestamp] = Date ' for the date only, use Now for date & time
End Sub


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
  #3  
Old September 23rd, 2004, 04:21 PM
Claire
external usenet poster
 
Posts: n/a
Default

Sometimes I over think things and try to make my work way too
difficult.....:-(

Many, many thanks John! Works wonderfully!!

Thanks also for all of the code in 'Microsoft Access 2003 - Inside Out'.
That wee reference book has saved my bacon more than once!! ;-)

Claire


"John Vinson" wrote in message
...
On Wed, 22 Sep 2004 22:37:25 -0600, "Claire"
wrote:

Hi:

On my query, I need to have a field that shows the date that a record was
updated, however, the date can not change until the record is changed. I

was
thinking that I can use the Date() function for this but I'm not sure how

to
make it update with changes.

A solution would be awesome.

Thanks in advance.
Claire


You will need to do all your updating using a Form to accomplish this:
table datasheets have no useful events. You might need to implement
security (or draconian punishments, or both) to prevent people from
going around the form and editing data in a table or query datasheet.

Put a date/time field (let's call it Timestamp) in the table and
include it in the Form's recordsource query.

In the Form's BeforeUpdate event put

Private Sub Form_BeforeUpdate(Cancel as Integer)
any form validation code goes here
if the data passes...
Me![Timestamp] = Date ' for the date only, use Now for date & time
End Sub


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps


  #4  
Old September 23rd, 2004, 05:26 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Thu, 23 Sep 2004 09:21:01 -0600, "Claire"
wrote:

Thanks also for all of the code in 'Microsoft Access 2003 - Inside Out'.
That wee reference book has saved my bacon more than once!! ;-)


One of my favorite books too... my friend John Viescas was kind enough
to send me an autographed copy!


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering on custom date field MED Contacts 3 September 17th, 2004 03:05 PM
more dates!!! brigid Running & Setting Up Queries 6 May 26th, 2004 10:59 AM
Formatting dates in Excel bernrunner15 New Users 4 May 11th, 2004 10:32 PM
Does date fall between two ranges? MR Worksheet Functions 4 January 14th, 2004 04:08 PM


All times are GMT +1. The time now is 04:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.