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!

vb.net database calculations 1

Status
Not open for further replies.

ArthurPurdy

Programmer
May 10, 2007
3
0
0
ZA
Have a table in Access db called readings. My form has three text boxes. txtCurrent, txtPrevious and txtDifference. I need to put in the new reading. The difference between this input and the previous reading in the table needs to be outputed into txtDifference box.
How do I do this?
I usually program in vb6. trying to learn vb.net 2005.

Thanks in advance
 
txtDifference.Text=Val(txtCurrent.Text)-Val(txtPrevious.Text)


Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Thanks for that. What I need to know is.. In the batabase table there are 2 columbs. readings and usage. I need to know how to get the previuos reading into the txtprevious. once I enter the current reading, the calculation then takes place to give me the usage, and when I click save saves the current reading and the difference into usage in the database.

In vb6 I put the previous reading into a variable and use it later in the calc. I can't seem to get it right in vb.net 2005

The application is for our orphanage. I need to keep track of the electrical and water usage of 14 houses. The sponsors of the house need to know the usage.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top