Solved

Proper order

Posted on 2000-04-17
5
145 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, AzraSound.  I removed the load frmMain and it works great.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

772 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

11 Experts available now in Live!

Get 1:1 Help Now