Solved

Proper order

Posted on 2000-04-17
5
146 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now