Results 1 to 3 of 3

Thread: simple mathematics ans SQL insertion?

  1. #1

    Thread Starter
    Hyperactive Member sterankin's Avatar
    Join Date
    Jul 2001
    Location
    N.Ireland
    Posts
    336

    Question simple mathematics ans SQL insertion?

    Hi there,

    I have an access database, and one of the columns is called "Tab" , as in a bar tab (how much a person owes)

    On my VB form I have a text box, I want it so the user can enter in an integer in the text box and click a button, and it will ADD this number to the current number in the tab field of the DB.

    I dont want the exisiting number in the DB to be overwritten, I want a new total to be created.

    Anyone know how to do this?

    mANY THANKS

    Steven


    "The Dude abides...."

  2. #2
    New Member
    Join Date
    Oct 2001
    Location
    Springfield, IL
    Posts
    2
    Well, if I get want you want to do, then something like this:

    dim an integer to hold the tab amount, open the recordset and retrieve the current total. Store the current total in the integer you dimmed. Add the text box to the dimmed integer. Your total is now in the dimmed integer. Save that to your recordset.

    Or kinda like this:

    <code>
    dim iTab as Integer

    iTab = adoPrimaryRS("tab")
    adoPrimaryRS("tab") = adoPrimaryRS("tab") + iTab
    adoPrimaryRS.Update

    </code>

  3. #3
    Lively Member
    Join Date
    May 2001
    Location
    Akureyri, Iceland
    Posts
    69
    How are your tables set up?

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