Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date calculations 1

Status
Not open for further replies.

mezentia

MIS
Jul 21, 2006
1
GB
I am trying to develop a small document management system.
I have for each document an issue date and a period, in months, that defines the frequency the document needs to be reviewed, e.g. every 6, 12, 18, months, etc. I want (a) to be able to hold the calculated review date in a field in the document table, and (b), be able to allow the user to add a specific date where the frequency is zero (undefined). I can get the review date to be displayed on a form using the dateadd function, but how can I make the calculated value populate the appropriate field in a table, and how do I force the user to enter a date if the frequuency is zero? This is my first access application and I don't want to get into VB code unless really necessary.
 
If you are absolutely determined to avoid code, you can do this with a macro.

Make the Control Source of the ReviewDate control be the table field that will store this value.

Assuming the controls on the form are in the following order:

IssueDate
Frequency
ReviewDate
OtherField

Then attach the macro to the On Exit event of the Frequency control.
Add the Condition column to the macro window, and the condition should be something like this:
[Frequency] Is Not Null

The first action is Set Value, whose arguments are Item: [IssueDate] and Expression: your DateAdd function (without the =)

The next action is GoToControl and the argument is OtherField

Lilliabeth
-Why use a big word when a diminutive one will do?-
 
I just realized: the condition should probably be
[Frequency]<>0

probably Frequency has a default of 0

Lilliabeth
-Why use a big word when a diminutive one will do?-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top