hello,
does any1 here noes how to multiply all the values by a number and update it back to the database.
I'm using microsoft access and VB 2005
eg. multiply by 2
Value
--------
2
10
8
result
-------
4
20
16
Printable View
hello,
does any1 here noes how to multiply all the values by a number and update it back to the database.
I'm using microsoft access and VB 2005
eg. multiply by 2
Value
--------
2
10
8
result
-------
4
20
16
You are also doing 3 tier right? My codes may not be working very well but I think you need make some changes. You can go here to see my codes http://vbforums.com/showthread.php?t=481044
Loop through all the numbers in that column (you haven't told us what the control is that you're using). Once you do, modify the corresponding values in the dataset.
Or, provide an edit template with a button that executes a bit of javascript next to it, when the user clicks save, simply save to database.
So, look up both methods or whichever one is closest to what you were thinking but didn't write.
but i don't need it to show it out. I just need to update in the database.
I need to click a button to activate this function only.
Now that'd be possible using some SQL, but I must mention that you shouldn't be storing calculated values in a database. It's redundant because the data is already there. You should always calculate the values you need when they are to be retrieved.