The only way you can get that error with the code snippet you have shared is if
Text1
,
Text2
or
Text3
do not have a
Text
property. It is unclear what controls those are meant to be as they are not the default names
There are other problems with your code:
1. Use sensible names for buttons and textboxes. You might be able to remember just now that Command1 tells you what type of triangle you have described, but when you come back to the code in 6 months time, after you've added functionality - will you still remember? Get into good habits as soon as possible.
2. I think that you think you have defined 3 integers with
Dim a, b, c As Integer
but you are probably going to find that
a
and
b
are Variants. Try explicitly declaring your variables e.g.
Dim a As Integer, b As Integer, c As Integer
3. I'm not a fan of single letter variables either - try to be more descriptive
4. Consider the line
c = Text3.Text
You're going to get a "Type Mismatch" error on that line because
Text1.Text
is ... er ... text, a string and
c
is an integer. Some compilers let you get away with it and make an implicit conversion for you but if you leave the textbox blank the compiler cannot cope. Make sure any change of type is obvious and your code will be more robust and portable e.g.
c = Val(Sheet1.Text3.Text)
After addressing all of the above there is nothing actually "wrong" with the code you have presented, but note I used the word "portable" above? If you can drop the use of VB6 then you should drop it and use VB.NET (or C# if you prefer). VB6 hasn't been suppported by Microsoft in decades. If your school insists on you using VB6 then leave and spend your money elsewhere.
Finally, try to use more meaningful titles for your questions - mostly everyone who posts in QA is looking for help :-) Avoid using "txt-speak" (plz) if you want to be taken seriously