?
Solved

Proper order

Posted on 2000-04-17
5
Medium Priority
?
157 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 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