Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Self-Updating Label

    Sub CalcNet()
    Dim curNet As Currency
    curNet = 0

    If IsNumeric(BoxGross) Then
    curNet = curNet + CCur(BoxGross)
    End If
    If IsNumeric(BoxAdj) Then
    curNet = curNet - CCur(BoxAdj)
    End If
    If IsNumeric(BoxTax) Then
    curNet = curNet - CCur(BoxTax)
    End If
    NetNet = Format(curNet, "0.00")
    End Sub

    In a UserForm where the Box? are text boxes and NetNet is a Label, I wanted the Label to update itself and show the computed Net Sales as the Box? amounts were put in.

    The code above is what I have in place but the label does not change as the other three entries are made! Can someone tell me what I'm doing wrong? Please?
    - Ricky

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Self-Updating Label

    A couple of things to look at:

    1- How is this code being executed? You probably need to insert a call to this procedure in the Change Event Procedure for each of the three text boxes so that the total gets recalculated each time any of them is changed.

    2- I think that you need to change the way you are referring to the text boxes. I don't know if what you have will work, but I think a better way would be:

    Form1.BoxGross.Value

    Where "Form1" is the name of your form.
    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Self-Updating Label

    Legare:

    Thanks - I added "Calls" to each of the three change events and that fixed it right up. I should've known that! <img src=/S/doh.gif border=0 alt=doh width=15 height=15> I appreciate your quick response.
    - Ricky

Posting Permissions

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