Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    48

    Question Unanswered: Running Sum on an ACCESS form

    I'm looking for code for an "on click" event procedure that will accomplish the following:
    I want a text box on a form to maintain a running sum generated by clicking an adjacent command button. The first result would be 1 and the next click would produce the result 2, etc.

    Help please and thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by elizabeth1
    I'm looking for code for an "on click" event procedure that will accomplish the following:
    I want a text box on a form to maintain a running sum generated by clicking an adjacent command button. The first result would be 1 and the next click would produce the result 2, etc.

    Help please and thanks.
    And would the next number be 3 or 5? This is too simple to ask for help on ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    Welcome Aboard!

    in your on click ebent something like this should do the trick.

    Code:
    Dim Something as Intiger
    something = (me.textbox + 1)
    me.textbox = something

    Note if the textbox is empty (NULL) when you click the button you will get an error. As such you may wish t oset the texbox value onload.

    My 2 cents.
    Darasen

  4. #4
    Join Date
    Aug 2004
    Posts
    48
    In response to M. Owen's question: the next number would be 3.
    Last edited by elizabeth1; 12-09-04 at 19:11.

  5. #5
    Join Date
    Aug 2004
    Posts
    48

    Running sum

    Thanks Darasen. It's working perfectly.

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by elizabeth1
    In response to M. Owen's question: the next number would be 3.
    Then it's not a running sum ... It's a sequence number ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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