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

Table "Date Last Modified" Property

Status
Not open for further replies.

yonaker

Programmer
Jan 19, 2006
2
US
I am trying to use the "Date Last Modified" property of a table in a VBA module. I have noticed that when I change the data in the table and press save, the correct time and date has been applied to my table. However, if I change the data in the table and close the table with the "X" in the upper right corner, the data is saved BUT the Date Last Modified entry has not been updated. Furthermore, if I change the table data via a form, the same thing happens, i.e. the changes are saved to the table but the date and time has not been updated. It seems that this field is not very useful if the correct date/time of the last modification is not applied. Any assistance would be greatly appreciated. Thanks
 
I don't know what the Date Last Modified property of a table in a VBA module is, and

I don't think it's possible to record the date last modified when data is entered directly into a table without using a form. Somebody correct me if I am wrong, please.

How about this in a form that has a control named txtLastModified:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)

    txtLastModified.Value = Now()


 
Like Lilliabeth I am puzzled by your reference to a '"Date Last Modified" property of a table in a VBA module'.

I suspect you are actually talking about the Modified property of the table itself (which you can see by right-clicking on the table and choosing Properties). This refers to the date the table structure was last modified, not the data in the table. I just did a little test, if I open the table, then press the Save button, it does indeed update the Modified property of the table, even though I hadn't made any actual changes to the table design (or even the layout, for that matter).

 
...which leads to how to capture such information in the first place. Depending on the level you need, you could start with using the before update event of the form to stuff dates into created date, modified date, userid ... types of fields (as demonstrated by Lilliabeth). For more, then you have for instance something like MichaelReds transaction log here faq181-291.

Roy-Vidar
 
I guess that I didn't explain myself very well. I apologize since I am new to Access. Basically, all I want to be able to extract is the last date/time when the data in my table was modified in some way. When you view all of the tables in a database (just like all forms, reports, modules, etc), you see a date modified, date created, etc beside each table name. It sounds like from the responses that this date applies to when the structure was last modified not the data itself. I thought that there must be a way to determine when the data within a table has been changed. I hope that this helps with any future assistance. Once again, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top