How to add, subtract, multiply and divide 2 different numbers from 2 different form. Pls help me. The code i think is way too simple example: (Result.text = result) (Text1.text = number from form2)(Text2,text = Number from form3). the code i think is like this and this one is not working:

Public Sub Command1_Clicked()
Result.text = Val(Text1.Text) + Val(Text2.text)
End Sub

Pls help me... i cant sleep because of this problem.

How to add, subtract, multiply and divide 2 different numbers from 2 different form. Pls help me. The code i think is way too simple example: (Result.text = result) (Text1.text = number from form2)(Text2,text = Number from form3). the code i think is like this and this one is not working:

Public Sub Command1_Clicked()
Result.text = Val(Text1.Text) + Val(Text2.text)
End Sub

Pls help me... i cant sleep because of this problem.

Try

Public Sub Command1_Clicked()
Result.text = Val(Form2.Text1.Text) + Val(Form3.Text2.text)
End Sub

Now go to bed!

Try

Public Sub Command1_Clicked()
Result.text = Val(Form2.Text1.Text) + Val(Form3.Text2.text)
End Sub

Now go to bed!

Thank You Very Much!!!!!!!!!!!!!!!!!!!!!!!

Can I be able to write a simple program to accept two numbers in one textbox including an operator +,-,/,*, using vb 2010

Can I be able to write a simple program to accept two numbers in one textbox including an operator +,-,/,*, using vb 2010

yes , it can be written and in fact its very easy to achieve , you just need to put 2 textboxes and 1 command button and make use of arithmetic operators.

you can also accept these numbers using inputbox.

for further assistance , i highly recommend you to post the question in appropriate thread , we have seperate forum for vb.net.

pls anyone tell me what is the error in this code for (n=a1-a3)

Dim a1, a2, a3, a4, x, n As Integer
Private Sub Command1_Click()
a1 = Val(Text1.Text)
a2 = Val(Text2.Text)
a3 = Val(Text3.Text)
a4 = Val(Text4.Text)
x = a3 + a2 - a4
n = a1 - a3
Text5.Text = x
Text6.Text = n
End Sub

There is no error in the code, For future reference please read the Daniweb Posting Rules. Particularly the part about hijacking old threds.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.