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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |