Formulae in reports

master_dragon_1

Registered User.
Local time
Today, 16:19
Joined
Aug 27, 2003
Messages
19
Hi!

I have a VERY simple problem, but I cannot solve it. I was struggling since last night!

I have a table which contains items and their quantities in stock. Now, I have a query that contains all the items that are more than one in stock.

Now, I want to create a report. When the report has been made, it shows all the items and their quantities. This, I have no problem with.


Now, I want to create a formula, so that, all the qauntities shown will have 1 deducted from it. So, in effect, the formula should be:

=[quantity]-1

or something like that. I have tried so many times, but, nothing seems to work. It is the first time that I have tried to input a formula into a report, and that is what is causing the problem. Can someone please help?
 
If you used the report wizard to generate your report, the text box that would contain the Quantity field is also named "Quantity" and if you try to use an expression in that control it will not work.

=[Quantity] - 1

is the correct expression (assuming you have a valid field named Quantity). You simply need to change the name property of that control to something other than "Quantity", such as "txtQuantity".
 
Hi!

It works!! Yay!!! Thanx alot. Just out of curiosity, why won't it work if you don't change the name of the control from Quantity to txtquantity or something like that? It does work with the same name if there is no expression. Thanx for our help!
 

Users who are viewing this thread

Back
Top Bottom