Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ugly form (A2000)

    I have a form which has 3 subforms, when this form loads, the subforms load before the main.
    Although the time difference is only about 1 second, it looks quite ugly and slow.

    I don't really want to alter the design too much as it is the heart and lungs of the whole database.

    The form is loaded from a menu, perhaps a way to open it behind the menu invisibly.

    I don't know, any suggestions.

    Dave

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ugly form (A2000)

    I haven't tried this, but perhaps it helps if you keep the form hidden at first.

    DoCmd.OpenForm FormName:="frmMyForm", WindowMode:=acHidden
    Forms!frmMyForm.Visible = True

    Regards,
    Hans

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ugly form (A2000)

    So close. It works and helps the main to appear quicker when it is called.
    But
    When opening the menu, the main form very briefly appears and then goes to hidden.

    DoCmd.OpenForm FormName:="frmMyForm", WindowMode:=acHidden

    I wonder if the form can be made invisible before it loads ???

    Dave

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ugly form (A2000)

    Unfortunately, the Visible property of a form can't be set in Design view, only in a macro or VBA.

    You *can* set the Visible property of subforms to False in Design view. I don't know what happens if you do that, and add

    Forms!frmMyForm!sbfMySubForm.Visible = True

    to the code (for each subform).

    Putting Me.Visible = False in the OnOpen and/or OnLoad event of the form do nothing when you open the form from the database window. You might experiment to see if it helps in your situation, but I doubt it.

    Otherwise, I'm out of ideas.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ugly form (A2000)

    I've done it.

    Set all subs to visible=false then true when the main opens.

    Now, the subs open exactly on time with the main.

    Thanks once again Hans

    Dave

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ugly form (A2000)

    Actually, the subforms still open first, it's just that you aren't making them visible until the main form is finished opening.

    Another way to handle it is to turn off the screen echo until the bottom of the Form_Open event and then turn it back on. If you use that, though, make sure your error handling is solid and that any error will immediately turn screen echo back on.

    Still another alternative is to use unbound subform controls and bind them late in the Open event of the parent form by setting their SourceObject and LinkChildFields and LInkMasterFields properties immediately thereafter. They can't load first if there's nothing set up to load.
    Charlotte

Posting Permissions

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