Equations

tgambill

Registered User.
Local time
Today, 00:49
Joined
Dec 21, 2012
Messages
12
I have a form that I would like to take the number in one field (Current Inventory) and subtract it from the number in another field (Desired Inventory). I created a query from the original table and put the equation in. This works in the query. I then put the 2 field boxes into the form and a generic text box for the equation named "Number to Order". In the property sheet of the text box, I entered the equation (=[desired inventory] - [current inventory]). This results in #Name? in the text box.

I also tried entering (=[Number to Order]![Desired Inventory]-[Number to Order]![Current Inventory]). [Number to Order] is the name of the query. This also resulted in the #Name? notation. Sometimes it has resulted in the notation #Type!

Any suggestions would be appreciated.
 
If you have an expression in the query taht your form is based on, just set the control source of your results textbox to be the same as the expression in the query.

either that or fix the equation to be: = ([desired inventory] - [current inventory])
 
The form is based on the table. I also tried to enter the equation you list and that does not work either.
 
Here is something interesting which to me makes no sense. I created a column in the table named Number to Order. I then added that to the form and set the visibility to No. Now the equation works in the original text box. However, if I then close the database and reopen it, I get the same error message I received before.
 
I appear to have solved the problem. I clicked on "Compact and Repair Database" and it seems to be working correctly now. Thank you for taking the time to look into this for me. Sorry for the inconvenience.
 

Users who are viewing this thread

Back
Top Bottom