subtracting one field total from a second field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me, I have 2 tables, one table "stock" has a field "QTY" the
second sub furm "Materials Subform" has a field "QTYUsed". What i want to do
is subtract the "QTYUsed" from the "QTY" . I am aware that i am probably not
structing the data correctly. I have a button on the form that i will click
to operate the code. I was thinking along the lines of the following

me.QTY - me[materials subform].qtyused = me.tempQTY
me.tempQTY = me.QTY
me.tempqty = 0

But it doesnt work, can anyone piont me in the right direction
 
Hi,

you say you have 2 tables, but only name “stockâ€. Assuming “Materials
Subform†is also a table, I would handle it like this:

Create a query based on the field “OTY†from table“stock†and field
“OTYUsed“ from table “materials subformâ€. Write the following expression in
an empty field of the query: [QTY] – [OTYUsed]

Save the the query and create a new form based on this query incl. all
fields.

Viola!

Frank
 
Back
Top