Thank you Dirk, I think the DoEvents did it. I need to look into this one a little more, but it works great now.
"Dirk Goldgar" wrote:
[Quoted Text] > "DDBeards" <DDBeards[ at ]discussions.microsoft.com> wrote in message > news:98975944-3A89-40ED-A2CF-ADAF140DF844[ at ]microsoft.com... > > This is my second post on this, sorry but I really need help on what > > should > > be a simple task. I have a splash form that I wish to display when the > > system starts (called by the on start). I have tried it several ways, > > including on open, on load, and even on timer but the results are the > > same. > > When the form opens I need to call a sub to run a macro that loads my data > > tables. But here is what happens, either the form does not appear until > > the > > macro is over or just the border and title appear with no body to the form > > until the macro completes. How can I open a form so that it can be seen > > and > > then run a maro. > > > > by the way the on timer works but repeats, is there a way to execute a > > timer > > only once? > > > > Please Help > > > > Chris > > > Chris, I don't think I have quite enough information to give you solid > advice, but I'll try to suggest some things. To answer your last, most > specific question first: > > > is there a way to execute a timer only once? > > Yes: in the Timer event, set the Me.TimerInterval to 0. > > For the more general question: as I understand it, your form is not > becoming fully visible because it's waiting for the data-load process to > complete. One way you could try to force this would be: > > Private Sub Form_Open(Cancel As Integer) > > ' Try to force the form to become visible. > Me.Visible = True > DoEvents > > ' Run data-loading process. > DoCmd.Hourglass True > Call YourDataLoadingProcess > DoCmd.Hourglass False > > End Sub > > I don't know if that will work or not. > > A different approach might be to open a different form (maybe hidden) and > let that form run the data-load process. Maybe that would get Access to > spin off a different thread. > > Or maybe use the form's Activate event to run the process, but have a flag > so that you only do it the first time the form becomes active. > > -- > Dirk Goldgar, MS Access MVP > www.datagnostics.com > > (please reply to the newsgroup) > >
|