CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2000
    Location
    Indiana USA
    Posts
    193

    Closing one form, but need to re-entering later

    I have a main form (Menu) that has a Option button to
    take the user to another form. Code:

    private Sub optHeader_DblClick()
    If optHeader.Value = true then
    Load frmHeader1

    End If
    End Sub



    The Form_Load code for frmHeader1 is:

    private Sub Form_Load()
    frmHeader1.Show
    Message = InputBox$("Enter Message for Printing on Check Stub", "Check Stub Message")
    Deduct = MsgBox("Do You Wish to Block Any Deductions This Pay Period?", vbYesNo + vbDefaultButton2)
    Report = MsgBox("Do You Wish to Override Your Normal Report Requests?", vbYesNo + vbDefaultButton2)
    fraDate.Visible = true

    End Sub



    Information is then added by the user from controls in the frame fraDate. After the info is entered, I want a way to close this form and show the Menu again. I can accomplish this, but it will not let me go back into the frmHeader1 a second time. I need to be able to got back into that form as many times as possible. Thank you in advance.

    Catrina



  2. #2
    Join Date
    Jan 2000
    Posts
    34

    Re: Closing one form, but need to re-entering later

    I don't know if you are unloading frmHeader1 when you close it or not, so the form may already be loaded, just not shown. After loading the form, use

    frmHeader1.Show




    If you want to display the form as a modal form, then use

    frmHeader1.show vbmodal




    Hope this helps.
    Kymberlie


  3. #3
    Join Date
    Feb 2000
    Location
    Indiana USA
    Posts
    193

    Re: Closing one form, but need to re-entering later

    I got the immediate problem fixed, but need to know if there is a way to get rid of close X in the corner. I want the user to only be able to use my exit button. Thanks

    Catrina


  4. #4
    Join Date
    Jan 2000
    Posts
    34

    Re: Closing one form, but need to re-entering later

    Set the ControlBox property of the form to False. This will remove the min, max, and restore buttons from the upper right corner of the form.

    Kymberlie


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

Featured