Update form everytime database is opened

mixup

Registered User.
Local time
Today, 07:06
Joined
Jul 29, 2005
Messages
34
One of the forms in my database has a calculated text box control. The calculation is conditional, one condition being based on current date. One of the queries display that calculation. If the the form with the calcualted control is not opened before running the query, the calculated control uses the day the form was last opened as the "current date" which is not what I want. I want to do one of two things:

Either: (Preferably): update the form everytime the database is opened, so that the current date is actually the current date and not when the form in question was last opened.

Or: Update the form first before the query in question is run. This is not preferred because, if I use the calculated control in another query or something, I have to have another "update" step.
 
Forms don't store data. Tables store data. If you want to reference a field on a form, that form MUST be open. If you are trying to keep track of when something was done, create a table to hold the information. You cannot use a form for this purpose.
 
I apologize. I didnt quite clarify that. Basically, there is a table ("incidence") with three fields: "Init_date", "end_date", and "duration". "duration" is the number of days between "init_date" and "end_date". If there is no "end_date", "duration" is the number of days between "init_date" and current date (todays date).

There is a separate table ("usage") where there is a field called "days_used". Both "days_used" and "incidence" tables have a common field "PPN" .

There is a parameter query, that asks for the "PPN"; when entered, it adds the total number of days from the "days_used" and "incidence" tables.

If the "incidence" table has not been opened the day the parameter query is run, the "days_used" for a "PPN" without an "end_date" uses the day that table was last updated (using it corresponding form) as the current date. I would like the "incidence" table to update every time the database is opened. Is that possible? The alternative is to add an additional step (update incidence table) to the command button that opens the parameter query.
 
You shouldn't store the Duration. It can be calculated at any time
 

Users who are viewing this thread

Back
Top Bottom