Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding to an existing number in a record

Status
Not open for further replies.

megasuperman

Programmer
Aug 20, 2001
21
US
Ok here is what I need to do,
I have a recordset called Inventory, I need to update the quanity of a certain part number:
for example part # dw5469 quanity 15
add 5 more to that part
giving 20 simple math but cant figure out how to work that in to the recordset

the form manager updateRecord() will just overwrite the current record

If anyone can help or even give suggestions I would greatly apreciate it
 
well you select only this recordset from the database (single) it out

the go for rs("YourFieldName") = rs("YourFieldName") + 5
rs.update

where rs is your open recordset
Unicorn11
unicorn11@mailcity.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
I think I need to be a little more clear,

I am using an SQL database
I have two Tables Inventory and STOCK
Inventory is a large Table with all the inventory ever ordered and the individual order number
when received I need to update STOCK that has 3 Fields
PartNumber RegionId Qty
all 3 of these fields are in Inventory as well

When an employee clicks on receive inventory it takes them to a page asking for ordernum when they enter the order number it takes them to the next page which brings up a record set with only that record from Inventory when they click on recieve I need it to add the Qty to record in the STOCK table that matches that PartNumber and that RegionId

OrderNum from Inventory = WO89347
brings up record

OrderNum PartNumber RegionId Qty otherinfo
WO89347 DW5486 5 10 .....

In STOCK
Where PartNumer = DW5486
Where RegionId = 5
Add = 10 to the current Qty

So that the PartNumer DW5486 in the Region 5 now has 25 or whatever

Anyway hope that is clearer
THANX ALL for your help
any help is appreciated
 
you can open two recordsets and use either one to update its respective tables

or

create a procedure at will update two records
Unicorn11
unicorn11@mailcity.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
thanx I got it

I had the two recordsets but couldnt get them to add to eachother
figured it out and had to add
parseFloat(QtyI.value) + parseFloat(QTYS.value)

because it was adding itself to the end such as 3 + 3 = 33
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top