Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103

    Unanswered: Hide Form Detail Using Event Timer

    I'm trying to momentarily hide some controls in the detail section of my form while it opens using.......... 'Me.Detail.Visible = True'. The text boxes are, however, visible as soon as the form opens. Interestingly, when I change the above statement to 'False', the form opens with the detail section blank for a few seconds and then the text boxes appear.

    Why doesn't the opposite happen when it's 'True'? Is there another way to accomplish this effect?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Why hide the entire detail section verses just setting the controls themselves (ie..me.MyControlName.Visible = False)? Or make the default of each of the controls visible = False and then me.MyControlName.Visible = True.

    When you tell Access to hide the entire detail section, this is something not typically done so Access might be spending a little time processing hiding all the controls since the detail section is normally set Visible = true. You can also try setting the default of the detail section Visible = False and see if that affects the delay. (When you have the default Visible = True of the detail and when the form opens you do me.Detail.visible = False, you're actually telling access to "reprocess" the detail section, hiding it so Access has to hide everything while it's opened it unhidden.)

    An approach I use is I will have a subform on the main form where the sourceobject of the subform is blank. When the appropriate time comes, I set the sourceobject of the subform = "MySubformName". This way when the Main form opens, it opens very quickly as the subform doesn't need to be processed and only needs to be processed when I set me.MySubform.SourceObject = "MySubFormName".
    Last edited by pkstormy; 10-03-07 at 11:56.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103
    Actually, I have a couple controls and an OLE object as well. I neglected to mention that. I tried hiding the detail section during the form load and then used my statement with the Event time. That seems to work!
    Last edited by JamesB; 10-03-07 at 12:58.

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Personally, I wouldn't recommend using the Event Timer to make visible/invisible controls/detail section but if it works for you go at it.
    Last edited by pkstormy; 10-03-07 at 14:00.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You know there's an "After Render" event, right?
    George
    Home | Blog

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Good point George.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Aug 2007
    Posts
    25
    There is another workaround for this problem. It is cheating but it still works. You can create a rectangle with a background color the same as your form background color. Make it visible, then after your delay set the visible property to false. I know it is kinda a weird way to do it, but when all else fails use something simple...
    Kirk Wahl
    GM Powertrain SMCO

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I still don't get why this is being implemented...
    George
    Home | Blog

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Quote Originally Posted by georgev
    I still don't get why this is being implemented...
    Me either but I've also used the technique aldankirk suggested and it works very well and as he mentioned, is very easy to impliment!! You may have to manipulate setting the Tab Stop property to false for the controls though.
    Last edited by pkstormy; 10-03-07 at 23:03.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Still seems more trouble than it's worth...
    George
    Home | Blog

Posting Permissions

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