PDA

Click to See Complete Forum and Search --> : An easy one


baynham
Oct 19th, 2000, 08:53 AM
I want to add the number in my text box to the number in a database. I can get the number that is my text box to appear in the database. But it does not add it on to the number there before.

Also I would like to arrange the table in accending order using vb. And i need to display the highest number in the database in a text box in vb :( please can somone help.

Thanks.

Later, Mike

barrk
Oct 19th, 2000, 11:44 AM
You need to select your number from the database, set it to a variable and then add your number to it. Something like this:

Select myoldnumber from mytable

dim mynewnumber as integer
mynewnumber = myoldnumber + text1.text

''then update your mytable

update mytable set myoldnumber = mynewnumber where myfield = myoldnumber

To order your table just do something like this:

select myoldnumber from mytable order by myoldnumber ascending