Consulting

Results 1 to 4 of 4

Thread: Adding Text boxes to a Lable

  1. #1

    Adding Text boxes to a Lable

    I am currently adding several text boxes and inputting them to a label on the _change event. This works great but when I make a correction in the cell it erases the answer that is in the label. Is there any way to prevent the answer from vanishing when the user makes a change to the text box?

    Here is a sample of what I am doing.

    [VBA]If TextBox10.Text > "" Then
    Label27.Caption = Val(TextBox10.Text) + Val(TextBox11.Text) _
    + Val(TextBox12.Text) + Val(TextBox13.Text) + Val(TextBox14.Text) + Val (TextBox15.Text) _
    + Val(TextBox16.Text) + Val(TextBox17.Text) + Val(TextBox18.Text) + Val(TextBox19.Text) _
    + Val(TextBox20.Text) + Val(TextBox21.Text) + Val(TextBox22.Text) + Val(TextBox23.Text) _
    + Val(TextBox24.Text) + Val(TextBox25.Text) + Val(TextBox26.Text) + Val(TextBox27.Text) _
    + Val(TextBox28.Text) + Val(TextBox29.Text) + Val(TextBox30.Text) + Val(TextBox33.Text)
    ElseIf TextBox10.Text = "" Then
    Label27.Caption = ""
    End If[/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Drive it from a commandbutton, not the Textbox change event.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3

    Command button

    I had it that way but the form seemed too busy, so I changed it to the _Changed event in hopes of making it easier. Do you have any suggestions?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Not without seeing it and understanding your problem.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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