Calculations (1 Viewer)

Ibnul Ahsan Mayukh

New member
Local time
Today, 22:42
Joined
Feb 24, 2014
Messages
7
Well first of all should mention that i am an beginner with access and more importantly i cannot do any type of programming.
I am currently working o a Library Management System. most of the work is done but there remains two major problems.

  1. I want to calculate the fines that a member will have automatically on a form. i have a basic pseudocose which is
IF Loan.returned=0 AND ReturnDate<Today{note- i.e. date()\Today(), etc.}
THEN Loan.fine_BDT=20*(Today-Loan.ReturnDate)
Note2- The form has the following fields from a query which is connected to table loan-

  • LoanID
  • LoanDate
  • ItemID
  • MemberID
  • ReturnDate
  • DateReturned
  • Returned(Yes/no)
2. The other one is with the Mail merge. i Want to use a query to supply the data for a mail merge. However, since the database id encrypted with a password it cannot be reached.
I am currently using Access 2007. please answer 1 even if you don't answer 2. Thank you in advance.
 

nathansav

Registered User.
Local time
Today, 08:42
Joined
Jul 28, 2010
Messages
114
=iif(returned=false and returndate<date(),20*(returndate-date),"") in a text box on the form
 

Ibnul Ahsan Mayukh

New member
Local time
Today, 22:42
Joined
Feb 24, 2014
Messages
7
1.Did I mention that I was using a query to bring up records. :D
2. The sugestion above does not work. when i pasted it into a form field it says '#Name?'. (i corrected =iif... to =if...):banghead:
 

JHB

Have been here a while
Local time
Today, 17:42
Joined
Jun 17, 2012
Messages
7,732
1.Did I mention that I was using a query to bring up records. :D
The same calculation can be used in a query, (but I think the calculation isn't correct)
Code:
Iif(Returned=0 and ReturnDate<Date(),20*(Date() - ReturnDate),"")
Check up that the field names exist in the table and that the field types is the correct type.
Else post some sample data in a Excel sheet or database, zip it.
.... (i corrected =iif... to =if...):banghead:
Yeah - and then you made it incorrect :D :D - check up in the Help file the syntax and how the Iif function works.
 

Ibnul Ahsan Mayukh

New member
Local time
Today, 22:42
Joined
Feb 24, 2014
Messages
7
What exactly are you thinking of?
Well I will have a report with the loan given, taken, unreturned books, etc. I already have the query (parameter) prepared.:cool: So what I want is for the report to show the fine of each late book and no fine for books not late. I tried using the same function but it doesn't seem to work.:confused:
 

JHB

Have been here a while
Local time
Today, 17:42
Joined
Jun 17, 2012
Messages
7,732
..I tried using the same function but it doesn't seem to work.:confused:
Why not, what happen, any error number and description?
Post a stripped version of your database with some sample data (zip it) + info in which report you've the problem.
 

Users who are viewing this thread

Top Bottom