subtracting one field total from a second field

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top