Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  View Answers    Answer this question    Ask a question  
 

Mina Zaki
Mar 28, 2008, 03:06 PM
i did a very simple calculator

http://img176.imageshack.us/img176/7314/52886418qe8.png


And this is my code

http://aycu30.webshots.com/image/47789/2003224651406407843_rs.jpg


And this is the problem when I tried it.......

http://aycu14.webshots.com/image/47413/2003226318421073932_rs.jpg


http://aycu31.webshots.com/image/51030/2003242519318393365_rs.jpg


what is the wrong?

Please I need your help!:mad:

Username Here
Mar 29, 2008, 10:18 AM
Try "Else If"

I haven't done VB in a while, but I can't remember weather it will allow more than one if statement per private sub. If not try making A and B integers. Correct syntax means that "Text3.Text = A + B" should have its own line, but its a single line If statement so it may not affect it.

Sorry I couldn't be of much help, I haven't done VB in a while. I'm a C# nerd atm.
Louis

kabia
Apr 3, 2008, 11:46 PM
If you put :

"If Option1.value = true then Text3.text = A + B"

On one line....
You do not need to put the "end if" statement

But to correct your issue....

Private Sub Command1_Click()
Dim A, B
A = Val(Text1.text)
B = Val(text2.text)
If Option1.value = true then
Text3.text = A + B
End if
If Option2.value = true then
Text3.text = A - B
End if
If Option3.value = true then
Text3.text = A * B
End if
If Option4.value = true then
Text3.text = A / B
End if