Add a value to a Table field from Subform Control

N

Nahid

My Query is something like a simple part of inventory,
which I want to solve by the help of VB coding only, as
due to some reason, I dont want to create any relationship
among these tables:

I have a form "InvA" and a Subform in it named "InvB"
In the subform, there is fields like "SecNo" and "SecQty",
both are numeric field type.

There is a seprate table where I collect information
seprately, Table name is "MainTot". It has a
fields "MainNum" and "MainQty", both numeric type field.

Now my need is that From Form "InvA" on Command button
click event following should be done :

If my subform Control "SecNo" value will match exactly
with the Table Field "MainNum", then it should add the
Table field "MainQty" with subform control "SecQty", I
mean to say: MainQty=[MainQty]+[SecQty]
It should also be repeated till the end of the subform
line.

By this method, I will be able to sum the value without
posting the same thing again to other table. It will save
my lot of time.

Please help, as I am not very good in VB coding and
niether a good programmer.
 

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