timers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a yes/no check box - default value is no - when checked
yes i would like to invoke a timer that returns it to no (default) after 30
days.
 
Smys123,

I would suggest you create a simple table, one field (Date/Time data
type), one record, which is where the date is recorded for when the
checkbox is checked to Yes. So, on the After Update event of the
checkbox you could have a macro or procedure that would run an Update
Query to set the value of the date in this table to Now().

Then, on a suitable event in your database (I don't know enough to be
able to suggest specifically... maybe this is every time the database
gets started, or when a certain form is opened), you will need a further
macro or code, that will check the data recorded in the table, see if it
is more than 30 days ago, and if it is, run another Update Query to set
the Yes/No field back to No.

Having said that, this is an unusual thing to do, and in fact it is
somewhat suspicious... you are in effect, if you think about it,
replicating the same information in two different ways, i.e. whether the
Yes/No field is Yes or No, and whether 30 days has elapsed. I would be
interested to know why you need to do this.
 
Creating a database for an apt complex, check box for paid rent for the
month, after the month is up it returns to null
 
Smys123,

Ok, thanks for the further explanation. For what it's worth, I guess a
more common way of handling this sort of situation would be to have in
the database, for each tenancy, a TenancyStartDate and a RentAmount and
a PaymentFrequency, and then to simply record payments received
(Tenancy/Apartment, PaymentDate, Amount). On the basis of this
information, you can easily use a query to get a listing at any time of
the tenancies and whether the rent is up-to-date or overdue. The
specifics of the query would depend, of course, on your rules and schedules.
 
Back
Top