Solved

# display a formula in a query field

Posted on 2011-05-04
202 Views
Experts,

i would like to display a formula in my field, kind of like what excel shows in the formula field, but i want it to be displayed in a query field.

So let say i have in excel:
=25000 - 17 - 600

i want to show this in my query:

Formula
----------------------
25000 - 17 - 600

my field names that hold these values are: soldfor - fedex - crating

0
Question by:lucas911

LVL 75

Expert Comment

Example"

SELECT Table1.FIELD1, Table1.FIELD2, Table1.FIELD3, Nz([soldfor],0)-Nz([fedex],0)-nz([crating],0) AS MyFormula
FROM Table1;

mx
0

LVL 12

Accepted Solution

= [soldfor] & " - " & [fedex] & " - " & [crating]

HTH,
Daniel
0

LVL 13

Author Closing Comment

That's what i was looking for.
0

LVL 75

Expert Comment

"but i want it to be displayed in a query field."
lucas911
The answer you Accepted does *not* work in a Query field, which is clearly what you stated, and why I posted as such.  The answer you accepted only works as an Expression in a Text box on a Form.

And if you are not wanting to do the Math, then you would use this:

SELECT Table1.FIELD1, Table1.FIELD2, Table1.FIELD3, [soldfor] & "-" & [fedex] & "-" & [crating] AS MyFormula
FROM Table1;

mx
0

## Featured Post

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …