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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment or decrement a value in a table after form event

Status
Not open for further replies.

Talonjpc

Programmer
Jul 29, 2002
21
0
0
US
Hi Everyone:

I have a field in a table that keeps track of the total number of installed instances of a particular piece of software.
When a piece of software is added to a server in a form, I want to be able to increment the number in that field. Additionally I would decrement it when a piece of software is deleted.
Here is an Example: If Cobol is installed on a server named CCC5 and you delete it from the server, the field named Total Number Installed in the Software Table would be decreased by 1. If I added Cobol to a different system it would be increased by one

Any help would be great

Thanks alot,
Vinay
 
How about something like:

Currentdb.execute("UPDATE tblName SET num = num + 1 WHERE program = 'cobol'")
 
Why would you want to be to store in a field and have to worry about updating something you can calculate at anytime

select count(fld) from table where fld = "cobol"
 
I would need to calculate at any time the amount of entries in the table ComputerSoftwareList named cobol. That table is basically a linking table to link software to servers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top