
Access Developers Handbook - Strange Form Behavior
I had fun with this one, and I am not at all sure I understand it, so
I thought I'd post it for your amu{*filter*}t, and solicit your comments.
I imported frmTabCustomers from Chap7.mdb on the CD Rom, and made some
modifications. I use it as a subform in my app, displaying a single
note on each 'page' of the tab form (the parent record on the main
form can have many notes). Among the modifications, I took the code
from Form_Load and moved it into a public method called
RefreshDisplay. I replaced the Form_Load code with the following:
Private Sub Form_Load()
Me(mcstrTabCtl).Visible = False ' hide tab control
Me!txtNote.Visible = False ' hide text box which replaces
' adh subform
' Both controls are made visible again in the RefreshDisplay Proc
End Sub
With this code in place, funny things started happening.
Specifically, when the form loads, the tabs (pages) on the subform
flicker on and off. It appears to cycle through each of them turning
them all on and then cycle back through turning them all off. The
whole process repeats several times, altogether taking twelve seconds
on my P150/64 Megs RAM. There is no hourglass, but nothing in Access
is availible to the user while this is happening.
This behavior doesn't happen without those two lines in the form load
event. ( However, the subform with its many tabs labeled Page40 and
the like does present a confusing appearance to the user.)
So that how I spent my morning.... Anybody have any comments or
explanations?
Cheers,
Gordon Young
(Strip the SPAM for the actual address)