lscheer
07-11-2001, 09:59 AM
I have a simple calculation I'd like to perform in my form, but it doesnt seem to work. I want to calculate a percentage, using values from two fields, [Pre Test Raw Score] and [Test Score Total] to be displayed in a separate [Percentage] field. I used =(([Academic Credit]![Pre Test Raw Score])/([WORKSHOPS]![Test Score Total]))*100 as both the "Before Update" and "Control Source" properties, but just get the "#Name?" error. Any ideas on what I'm doing wrong?
Jack Cowley
07-11-2001, 10:10 AM
If [Pre Test Raw Score] and [Test Score Total] are two fields on your form then using:
=([Pre Test Raw Score]/[Test Score Total])*100
as the Control Source for an unbound text box should give you the number you want. Do not store the calculation in the table as this is not a good practice. Do your calculations as you need them
The_Doc_Man
07-11-2001, 10:10 AM
The first thing that jumps out at me is that your fields have different source table names (if I read that equation correctly.) Does the form reference a query that contains both tables? If not, then one of those fields isn't part of the current recordset that is driving the form. If that is the case, you get the NAME error because the named entity doesn't exist in the form's context.
Look at the "DLookup" function as a way to get a value from a table that wasn't part of the underlying recordset.
lscheer
07-11-2001, 01:00 PM
Thank you very much, but neither of these suggestions worked...
charityg
07-12-2001, 06:37 AM
but WHERE are the two fields located, and WHAT are their FIELD names. (Look in the properties window)
[This message has been edited by charityg (edited 07-12-2001).]
Hi All http://www.access-programmers.co.uk/ubb/smile.gif
My suggstion is to perform calculation on "On Current" Event of the form. It works great for me. I dont see any fault with the formula.
Cheers!
Aqif