Results 1 to 3 of 3

Thread: Simple problem yet difficult to me.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    19
    I have 2 forms and both forms has four option boxes.
    How do i get the result from form1 and add onto form2.

    e.g
    Form1 - one of the option is a = 5
    Now i am in form2, i click onto another option box(let say b =6) and hit the add button. How to add form1's a=5 onto form2's b =6 to show me a 11 using a print command.

    Thanks for your help
    God bless
    Nigel
    [email protected]

  2. #2
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    I don't know what you mean by Option boxes. You mean this ?

    MsgBox (CInt(Form1.Text1) + CInt(Form2.Text1))

    You have to convert the contents or else they will be concatenated. Of course you have to validate for a numeric value of text1 and text2.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  3. #3
    Addicted Member
    Join Date
    May 2000
    Posts
    240

    I dont compleltly understand but here goes.

    So you have to forms and once you click a option button on form1 that = 5 and then you go to form2 and click a option that = 6 then you clcik a add operator and you want to have the answer "11" to show up on form2?? What do you have to recieve the answer?
    I can guess for a answer using the caption for form2
    Why dont you use a command button? And A textbox for form2.?

    Form1
    Private Sub Command1_Click()
    Dim Number As Integer
    Number = 5
    End Sub

    Form2
    Private Sub Command2_Click()
    Dim Number1 As Integer
    Number1 = 6
    Form2.Caption = 5 + 6
    End Sub

    This might work..i just thought of it right now....havent tried it myself..
    Make sure that the caption for form2 is blank when you run the program..or it will just stay "form2" in the caption area.

    There is other ways am sure..but i dont know of them yet.
    Hope this helped.
    Later

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