Okay, first future reference. In VB's IDE, goto the menu>Tools>Options and put a check in the box next to where it says Require Variable Declaration.
Okay, now for your problem. You are checking Form1's windowstate and setting form2's. Is form2 even loaded? If not then the problem may be that you are trying to access the properties of a form that is not loaded.
But this does not make sense so I have to ask. Are you sure you are using VB6 and not .NET or VBA (Excel, access, word)?
SO, if you are sure that you are using VB6 then goto vb's menu>Progect>References and the first four items should be these in this order...
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
Don't know what to tell you abu, your original problem "form2.show" being highlighted was more than likely because form2 did not exist. Look in the object window (Project window) on the right and see what you have named your forms. Do you have a form or forms showing like this... formTest(Form1)... if so, the name within the parenthesis () is the file name and the name before the parens is the name you should use in code.
my form name is mreport. no problem with from & form. i write it just like an example. I have many button to show many form. all are ok. but only this form made problem. when I press a button to show then show this msg. when I press ok. then the form show. but no problem happend.