You are here:

Using MS Access/Automatic Change of Text After a Date

Advertisement


Question
Hi Scottgem,

(Using Access 2003 at work, 2000 at home)

Hope you can help.
I have a table with a couple of date fields. One giving the start of an activity and one giving when the activity will end.
Is it possible to have another field that changes in some way (preferably the text)when the end activity date has passed. So an activity runs from January to June 05, on the 1st July the other field goes from saying 'Pre Activity' to 'Post Activity'.

Regards

Ian

Answer
Yes and no. What you are really asking is if you can display a message when the End date has passed. Since this is essentially a calculation you do not need (and should not) store it in your table. This can be displayed in a control on a form or reports as needed and calculated on the fly.

The expression:

=IIF([EndDate] < Date(),"Pre Activity","Post Activity")

will do what you want. Just use that as the Controlsource for a textbox on a form or report.

HTH
Scott<>

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

©2012 About.com, a part of The New York Times Company. All rights reserved.