Results 1 to 2 of 2

Thread: Easy Question RE: Manipulating one form from another

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Location
    Chicagoland
    Posts
    92

    Easy Question RE: Manipulating one form from another

    This seems like it should be really easy, but I just can't figure it out.

    So form1 has two buttons, "Open" and "Close". When a user clicks on "Open" it would open form2. When the user clicks on "Close" it would close form2.

    My main problem is when the close button is clicked, how do I reference form2. For instance, when "Open" is clicked, there is a line of code that says:
    VB Code:
    1. Dim Frm2 As New Form2
    2. Frm2.Show()

    How do I declare Form2 in the "Close" method so I can do Frm2.close()?

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    One way is to declare frm2 as a module level variable, then you can access it anywhere in form1.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width