Can Access 2007 automatically clear date field after date hasexpired?

  • Thread starter Thread starter stevmich
  • Start date Start date
S

stevmich

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
 
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,
    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."

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top