Firstly, there is no need to have the "Amt Due" held in a
field in your table. It is better to create a query based
on the date fields in your table, and use this to
calculate the total due. Below is some SQL that you can
adapt to suit your needs. The syntax and logic will stay
he same, all you will need to do is change the table and
field names to coincide with the ones in your database.
SELECT TblLibrary.DateBorrowed,
TblLibrary.IdealDateOfReturn, TblLibrary.DateReturned, IIf
([TblLibrary]![DateReturned] Is Null,(Now()-[TblLibrary]!
[IdealDateOfReturn]),([TblLibrary]![DateReturned]-
[TblLibrary]![IdealDateOfReturn])) AS DaysLate, [DaysLate]
*0.2 AS AmtDue
FROM TblLibrary
WHERE (((IIf([TblLibrary]![DateReturned] Is Null,(Now()-
[TblLibrary]![IdealDateOfReturn]),([TblLibrary]!
[DateReturned]-[TblLibrary]![IdealDateOfReturn])))>=0));
Once you have got the query up and running, you can base
your form on it as opposed to basing it on the table.
Hope this helps
Paul
-----Original Message-----
I'm making a library database, and what I want to do is
that for every day a student is late returning a book,
then he is charged 20p . I have a field "Ideal date of
Book Return", and "Date Book was Returned", and "Date Book
was Borrowed", and "Amount Due" . These are the fields
relevant to the function I want to produce. What function
do I have to write, so that for each day a student is late
to return a book after the three week default period that
they have, they have to pay 20p?