Simple calculation

lscheer

Registered User.
Local time
Today, 01:27
Joined
Jan 20, 2000
Messages
185
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?
 
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 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.
 
Thank you very much, but neither of these suggestions worked...
 
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
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
 

Users who are viewing this thread

Back
Top Bottom