PC Review


Reply
Thread Tools Rate Thread

Can Access 2007 automatically clear date field after date hasexpired?

 
 
stevmich
Guest
Posts: n/a
 
      22nd Jan 2010
I am building an Access 2007 database where a user would enter the
start and end date of a holiday period in two date fields. I want
Access to automatically clear both date fields once the period has
expired. Can anyone tell me if this is possible and if it is what VBA
code I would need to use.

Thanks,

Steve
 
Reply With Quote
 
 
 
 
Al Campagna
Guest
Posts: n/a
 
      22nd Jan 2010
stevmich,
You can run an Update query against your table... to Null out
the StartDate and EndDate where today's date (Date()) is
greater than EndDate.

A more important question is... what triggers this Update?

If you open the database application every day, that would be a
good time to check the table for records that need updating.

I have a database that never (or rarely) shuts down, so I have
a button on the Main Menu that blinks a red caption
(on the supervisor's PC only)... indicating that some function needs
to be run... every X amount of days.
This could be totally automated, but the user would rather be
notified, and start the routine manually.

Something to consider...
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."








"stevmich" <(E-Mail Removed)> wrote in message
news:b733f91b-2537-413e-b699-(E-Mail Removed)...
>I am building an Access 2007 database where a user would enter the
> start and end date of a holiday period in two date fields. I want
> Access to automatically clear both date fields once the period has
> expired. Can anyone tell me if this is possible and if it is what VBA
> code I would need to use.
>
> Thanks,
>
> Steve



 
Reply With Quote
 
stevmich
Guest
Posts: n/a
 
      23rd Jan 2010
On 22 Jan, 14:14, "Al Campagna" <newsgro...@comcast.net> wrote:
> stevmich,
> * * You can run an Update query against your table... to Null out
> the StartDate and EndDate where today'sdate(Date()) is
> greater than EndDate.
>
> * * A more important question is... what triggers this Update?
>
> * * If you open the database application every day, that would be a
> good time to check the table for records that need updating.
>
> * * I have a database that never (or rarely) shuts down, so I have
> a button on the Main Menu that blinks a red caption
> (on the supervisor's PC only)... indicating that some function needs
> to be run... every X amount of days.
> * * This could be totally automated, but the user would rather be
> notified, and start the routine manually.
>
> * * Something to consider...
> --
> * * hth
> * * Al Campagna
> * * Microsoft Access MVP 2006-2009
> * *http://home.comcast.net/~cccsolutions/index.html
>
> * * "Find a job that you love... and you'll never work a day in your life."
>
> "stevmich" <stevm...@tiscali.co.uk> wrote in message
>
> news:b733f91b-2537-413e-b699-(E-Mail Removed)...
>
> >I am building an Access 2007 database where a user would enter the
> > start and enddateof a holiday period in twodatefields. I want
> > Access to automaticallyclearbothdatefields once the period has
> >expired. Can anyone tell me if this is possible and if it is what VBA
> > code I would need to use.

>
> > Thanks,

>
> > Steve


Thanks Al I'll give it a try. Regards, Steve
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 Date field shows Now instead of Date bobdydd Microsoft Access 4 19th Jul 2011 03:47 PM
Bound Date/Time field to automatically display the current date Billiam Microsoft Access Database Table Design 2 20th Sep 2009 11:13 PM
how do I clear an access database date field with visual basic? =?Utf-8?B?TGFycnk=?= Microsoft Access VBA Modules 5 15th Jul 2005 05:03 PM
Date fields automatically changing when today date matches date field entry.Help! Brian Cassin Microsoft Access Forms 1 15th Nov 2003 01:51 PM
Date fields automatically updating when field matches todays date!?! Help! Brian Cassin Microsoft Access Forms 1 14th Nov 2003 08:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:02 PM.