Solved

Proper order

Posted on 2000-04-17
5
151 Views
Last Modified: 2010-05-02
I have 2 forms, frmMain and frmSplash.

I want to have the Splash screen up first while the Main form is loading in the background.

This my code below in the Splash form....

-------------------
Option Explicit
Private Sub Pause(interval)
Dim Current
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub

Private Sub Form_Load()
Load FrmMain
   
Call Pause(5)
   
FrmMain.Show

End Sub

------------------------------
 
This code seems to work but, it seems to take a long time to load the splash screen.  If I were to take the Private Sub Form_Load() out, the splash screen loads a  lot quicker.

Any suggestions is appreciated
0
Comment
Question by:sopheak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2723975
try loading your splash form in your Sub Main function of the module

Sub Main()
    frmSplash.Show
End Sub


0
 
LVL 6

Expert Comment

by:MELeBlanc
ID: 2723983
Move your code to the Form Activate sub and be sure to unload your splash form.

e.g.

Private Sub Form_Activate()
Load FrmMain
     
Call Pause(5)
     
FrmMain.Show

Unload FrmSplash
End Sub
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 2723994
theres no need to Load frmMain before you call the pause

just keep the frmMain.show from after the function call
0
 

Expert Comment

by:timpeters
ID: 2723996
You could also put your code in the Activate event of the splash form.  This wouldn't be a problem because the Splash form would be unloaded anyway after your main form is loaded.  Therefore, the Activate event would never be called again to cause a problem.
0
 

Author Comment

by:sopheak
ID: 2724074
Thanks, AzraSound.  I removed the load frmMain and it works great.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question