Results 1 to 2 of 2

Thread: Show running total

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    120

    Question Show running total

    Back again. My previous question returned some useful code but I still couldn't get it to run properly so I made some changes to the form and hey presto! its looking a lot better already.

    Code is
    If optPaintA = true then
    txtPaintCost = val(lblPaintA)
    end if
    this is repeated for options B and C
    Also same code for Tiles and Carpet with relevant names.
    each result in txt***Cost is added to a txtTotalCost
    and only displays when the textbox is clicked.
    It increments the running total but I have to click on the totalcost box to see it each time.

    Now what I would like this to do is that when each value is in the relevant Cost box that it displays in the txtTotalCost box as a running total without having to click on the totalcost box

    Rosi

  2. #2
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    If I understand what you are asking then you can use the txt***_KeyPress() or txt***_Change() event to update the txtTotalCost each time a new value is entered for Paint, Tile, or Carpet. Create a sub routine that figures all of the values for the three and then call that sub from the KeyPress event in all three textboxes.

    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

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