Expression Builders/Equations in Queries

smiller

Registered User.
Local time
Today, 10:31
Joined
Aug 9, 2006
Messages
37
Ok my goal is to have a calculation in a query that includes a bunch of addition, division, and multiplication. (It uses 10 pieces of data) I tryed typing it in the expression builder but it doesn't work. I don't know if I am setting it up wrong or putting it in the wrong spot or what. I've tried some different things and I either get a blank box in that field or I get a syntax error. Also is there any way I can put the info received by the equation into a field in my table? Thanks
 
Hi!

The information you provide is not enough but I think it is not working because you are not using maths rules properly.
Is many ways you can put the info received by the equation into a field and I give you here one example:

Dim dbs As Database, rst As Recordset
Set dbs = currentDb
Set rst = dbs.OpenRecordset(SELECT * tblTest)
With rst
.edit ‘ or .addNew
rst!number= (number1 * number2 / number3) + number4
.update
end with
rst.Close
Set dbs = Nothing

Hope this can help you

JonyBravo
 
Calculations should not be stored. Especially when all the operands are in the same record. Your problem may be caused because one or more of the fields is null. Use the Nz() function around each field in the expression.

Nz(fldA,0) + Nz(fldB,0) - Nz(fldC,0) ......
 

Users who are viewing this thread

Back
Top Bottom