General information
Category:
Forms & Form designer
>I start Form1 from a program "do form Form1". On Form1 there is a command button that starts Form2 - "do form Form2". On Form2 there is a command button that starts Form3 - "do form Form3". With Form3 active I press another command button that has the code "Form1.refresh". That works fine. There is yet another command button that the code "Form2.refresh". When I press that button I get an error that says "Object Form2 not found". What am I doing wrong?
>
>Nothing, since form1 lives within a private variable of a program, its available to all methods, but since form2 lives in a method (ok, event: CLick()) its object reference goes out of scope instantly so you can't reference it that way.
>
>What you need to do is either decalre form2 as a PUBLIC variable before you DO FORM form2, keep passing these references along the forms, or make the forms modal.
Could you explain how I declare the form as a public variable and pass the reference along the forms?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only