Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 31st, 2005, 02:48 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default newbie question on form_load

In an app where the autoexec opens the main form, sometimes a lengthy procedure to refresh the links in the database is needed.

For this reason the progress is dislayed on a statusline on the main form. The call to the refresh-links procedure (itself in a module), is in the Form_load of the main form.

However, when the refresh launches, NONE of the objects (eg. the forementioned status-line) on the mainform are displayed until refresh-links is finished. Even an explicit me.repaint does not help. I understood that form_load is called AFTER the form is displayed.

Anyhints on how to get the form to appear in form_load before will be appreciated.
__________________
Tim
Reply With Quote
  #2 (permalink)  
Old March 31st, 2005, 04:56 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Form_Load
Form_Activate (can't activate that which is not loaded. I believe this is where the form becomes visible.)
Form_GotFocus
Reply With Quote
  #3 (permalink)  
Old March 31st, 2005, 05:21 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well the first line in help on "Load" says:
The Load event occurs when a form is opened and [u]its records are displayed</u>.


The first line in help on "Activate" says:
The Activate event occurs when a form or report [u]receives the focus </u>and becomes the active window.

(Underlines are mine)

I tried form_Activate but the same behavior occurs.
It "feels" like the control moves on to the other task that it simply never gets around to displaying. Maybe I need some kind of time delay.
Things like repaint and doevents did not do it.



Tim
Reply With Quote
  #4 (permalink)  
Old April 1st, 2005, 09:25 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If the waiting occurs every time you open the form, make the message visible immediately as the default on the form, then turn off the message in the last line of your lengthy procedure. That way it'll be there from the start: no need for putting anything in ON OPEN, ON ACTIVATE, or ON LOAD.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #5 (permalink)  
Old April 1st, 2005, 01:42 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.
Perhaps I miss something.
However, as I said NONE of the items on the main menu are displayed which are all visible by default, until the table-linking loop is done.

There is even a msgbox which pops up during the linking and the menu still does not display.


Tim
Reply With Quote
  #6 (permalink)  
Old April 15th, 2005, 01:31 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've had the same problem. The solution is simple. The form isn't completely loaded until after the On_Load event procedure is finished. But On_Timer events don't start occuring until AFTER the form is completely loaded.

So move your initialization/feedback code from the On_Load event to the On_Timer event. In On_Load set TimerInterval to 1, and in On_Timer, so that it doesn't repeat, set it back to 0.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question pbb Ajax 0 September 26th, 2006 05:47 AM
Newbie question savoym JSP Basics 1 August 16th, 2006 03:15 AM
Newbie Question - Sorry! KP Crystal Reports 1 June 13th, 2006 02:45 AM
C# Newbie Question jazzcatone ASP.NET 2.0 Basics 1 May 25th, 2006 10:18 PM
Newbie question maccer88 Access 1 October 18th, 2003 05:53 PM



All times are GMT -4. The time now is 02:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.