Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Previous Year

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scuba79 - 18 Mar 2005 01:25 GMT
I have a client that is using Access 97, they want to be able to archive some
records, however, I need to make sure that the records that they are
archiving are not from the previous year and I need to code it so that it
will be automatic for each year...

Example:  

2005 needs to keep all 2004 and 2005 records
2006 needs to keep all 2005 and 2006 records
and so forth...

What I would like to do is create a command button when clicked will look at
the current date and then make the determination of how far back to go....

Thanks in advance
fredg - 18 Mar 2005 05:37 GMT
> I have a client that is using Access 97, they want to be able to archive some
> records, however, I need to make sure that the records that they are
[quoted text clipped - 11 lines]
>
> Thanks in advance

Where Year(Date())  < Year(Date())-1
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Tim Ferguson - 18 Mar 2005 18:10 GMT
fredg <fgutkind@example.invalid> wrote in news:v4nce7n73qir.3bye5k76zjgd
$.dlg@40tude.net:

> Where Year(Date())  < Year(Date())-1

I think this is likely to be always false....

Tim F
fredg - 18 Mar 2005 19:20 GMT
> fredg <fgutkind@example.invalid> wrote in news:v4nce7n73qir.3bye5k76zjgd
> $.dlg@40tude.net:
[quoted text clipped - 4 lines]
>
> Tim F

Thanks for the correction, Tim.
It should have read:

Where Year([DateField]) < Year(Date()) - 1
Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Tim Ferguson - 18 Mar 2005 18:13 GMT
> I have a client that is using Access 97, they want to be able to
> archive some records, however, I need to make sure that the records
> that they are archiving are not from the previous year and I need to
> code it so that it will be automatic for each year...

Archiving records is fine: the best way is to create a field called
"Archived" and set it to true for the records that have been archived.
Or, if you prefer, you could use a DateTime field and set it to the date
the thing was archived.

You can look at your historic records with a query like "WHERE
Archived=TRUE" or even "WHERE ArchiveDate IS NOT NULL"; and active
records with an opposite criterion. And when you want to combine old ones
and new ones, you don't have to mess about with all this nasty UNION ALL
stuff.

There is no reason to create extra tables when you don't need them; and
it's always asking for trouble to store data in table names.

HTH

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.