Results 1 to 2 of 2

Thread: An easy one

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    11

    Wink

    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

  2. #2
    Hyperactive Member barrk's Avatar
    Join Date
    Sep 2000
    Location
    My own little world
    Posts
    274
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width