By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,069 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,069 IT Pros & Developers. It's quick & easy.

Access 97 automatic purge records

P: n/a
Is it possible to automatically purge records after a six month period
in Microsoft Access 97?

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Heather wrote:
Is it possible to automatically purge records after a six month period
in Microsoft Access 97?

You could create code something like this
Dim strSQL As String
strSQL = "SELECT TableName.* From TableName " & _
"WHERE TableName.DateAdded < Date()-180;"
Docmd.Execute strSQL

You could put code like the above in the starting form or autoexec macro
when the app starts. The problem is that if you have multiple users,
the code would run each time someone opens the app. It might be best to
create a table with one record with a field called PurgeDate. When the
opening form opens, check the purge date. If Null or Less than today,
run the code. Then update the PurgeDate to today. That way the code
runs only 1 time per day...usually by the first person into the app.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.