You are here:

Using MS Access/Calculating a table field


I have been creating a payroll system which is almost complete for the last two months. The problem is that the PAYE field is unbound and reflects the same in all records when I print reports.  I am therefore trying to calculate the PAYE field in the table which has a number of nested If...Then statements as per the ratings.  The problem is I don't know where to place this calculation whether in a code builder or vb code! So that I can just bind the value in the report.

Will greatly appreciate your help.

ANSWER: Calculated values should not be stored. If the calculation is complicated then create a custom function for the calculation and use it wherever you need to display the calculated result.

Hope this helps,

---------- FOLLOW-UP ----------

QUESTION: Hi Scottgem! I really appreciate your help.

On the same, I have a popup form(bankForm) in the main form (EmployeeForm) that is opened on button click ,it inserts the bank name and the amount and when the user clicks the OK button in the popup window, the values are supposed to reflect in the respective fields in the main form (EmployeeForm).  I would like to use the case statement as the field need to be updated by a certain value if one statement is true. Kindly help me out.

You might want to check out my blog entry on Displaying Data from Related tables. If you need to read the amount from the table the bank form is bound to, then use a DLookup.

Would need more details to help further.

Hope this helps,
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers

Answers by Expert:

Ask Experts




I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.


I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Brooklyn College BA

©2017 All rights reserved.