Visual Basic 6 [Adding/Linking Boxes Together]-VBForums
Results 1 to 7 of 7

Thread: Visual Basic 6 [Adding/Linking Boxes Together]

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Visual Basic 6 [Adding/Linking Boxes Together]

    http://www.uploading.com/files/V2RQ8...Files.rar.html



    Here are my files, baically i have made everything ok but i don't know much about the coding... where the boxes are i would like to put numbers in them (there are 12) and then the box near the bottom would then be linked to those 12 boxes so then it finds the total amount.

    and the next box under "total" would then subtract/add the total amount and then display it in the box.

    i'm a complete newb at VB and i was wondering if anyone could help me (your my last chance)

    i would be very very happy if someone could make me the code so then i can use it in my boxes, i only require this as this is the problem i'm having (i'm in a IT Course ATM learning in college about this).
    Last edited by Ghostman1; Sep 16th, 2007 at 07:01 PM.

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    Are these standalone textboxs (non-arrayed) or are they in a control array?
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    I think there in a controlled array because i copyed and pasted them to make them the same size and it said something about that.

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    Click on them individual and look at the property page.

    If they all have the same name, they are in a control array.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    Yea, they all have the same name it's a control array.

  6. #6
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    Try this
    Code:
    Private Sub Command1_Click()
      Text4.Text = Val(Text1(0).Text) _
      + Val(Text1(1).Text) _
      + Val(Text1(2).Text) _
      + Val(Text1(3).Text) _
      + Val(Text1(4).Text) _
      + Val(Text1(4).Text) _
      + Val(Text1(6).Text) _
      + Val(Text1(7).Text) _
      + Val(Text1(8).Text) _
      + Val(Text1(9).Text) _
      + Val(Text1(10).Text) _
      + Val(Text1(11).Text)
    End Sub
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Re: Visual Basic 6 [Adding/Linking Boxes Together]

    Code:
    Private Sub btnCalculate_Click()
            EnterAmountHere0 = CInt(txtInputs(2).Text)
            EnterAmountHere0 = CInt(txtInputs(3).Text)
            EnterAmountHere0 = CInt(txtInputs(4).Text)
            EnterAmountHere0 = CInt(txtInputs(5).Text)
            EnterAmountHere0 = CInt(txtInputs(6).Text)
            EnterAmountHere0 = CInt(txtInputs(7).Text)
            EnterAmountHere0 = CInt(txtInputs(8).Text)
            EnterAmountHere0 = CInt(txtInputs(9).Text)
            EnterAmountHere0 = CInt(txtInputs(10).Text)
            EnterAmountHere0 = CInt(txtInputs(11).Text)
            EnterAmountHere0 = CInt(txtInputs(12).Text)
            EnterAmountHere0 = CInt(txtInputs(13).Text)
            EnterAmountHere0 = CInt(txtInputs(14).Text)
            txttotal(0).Text = EnterAmountHere0
    End Sub
    Ok, i tryed making my own and i seem to get the last one to work but the rest don't want to work... the "EnterAmountHere0" is the text, in the name which is "txtInputs" and the "txttotal(0).Text" is the Total Amount box which is suppose to contain "EnterAmountHere0" as in all of them not just the last one, i'll try your thing in a different box and tell you if it works.

    P.S there suppose to Add (i tryed the + before the EnterAmountHere0 but it gave me an error).

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.