?
Solved

Load a form after another.

Posted on 2003-03-02
17
Medium Priority
?
126 Views
Last Modified: 2010-05-01
I have two forms. A splash Screen and a Main form.
I want the main form to load only after the splash screen.
I found out that they are both loading at the same time.
I'm using the splash screen as the first beeing shown.
I also have other forms that are Child of this main.
How do I do this?
Thank you!
0
Comment
Question by:figjus
[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
  • 7
  • 6
  • 4
17 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8051616
add a timer on the splash screen and set the spash screen as the startup form.Then add this to the splash screen:

Private Sub Form_Load()
Timer1.Interval = 3000 ' 3 seconds
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
frmMain.Show
Unload Me
End Sub
0
 

Author Comment

by:figjus
ID: 8051710
Yes, I have that but the frmMain still loads at the same time.for instance if i have a msgbox on form load of my main it will show even before the splash screen. then splash loads and then main is visible. but it still loads first.
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8051747
is your splash form set as the startup form?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052003
Right click on your Project File from the Project Explorer window.Then select Properties and make sure frmSplash is set as your Startup Object
0
 

Author Comment

by:figjus
ID: 8052097
yes it is. Startup object is my splash. this isn't supposed to happen... ugh?
0
 

Author Comment

by:figjus
ID: 8052103
I have another one set as child from this main and it doesn't load at the same time. actually I can't even load it!!! it's called: frmAbout
I'm using:
Load frmAbout
but it doesn't work... yeah i'm lame... :p
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052122
Can you post the code from your splash form? Have you used frmAbout.Show?
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052123
try frmAbout.Show
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052132
Also make sure your timer interval isn't too low.
A value of 3000 will be about 3 seconds.
0
 

Author Comment

by:figjus
ID: 8052156
I've tried frmAbout.Show but it says :"no MDI form available to load". Still don't know why but msgbox keeps showing up. Here's my timer:

Private Sub Timer_Timer()
LoadingBar.Max = 50
If LoadingBar.Value <> 50 Then
   LoadingBar.Value = LoadingBar.Value + 1
Else
    Timer.Enabled = False
    frmMain.Visible = True
    Unload Me
End If
End Sub
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052189
you need to add an MDIform as parent form... not regular form
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 120 total points
ID: 8052209
and try this for the splash screen. Make sure you set the timer's interval property.Try setting it at 100 and adjust as necessary.

Private Sub Form_Load()
LoadingBar.Min = 0
LoadingBar.Max = 50
LoadingBar.Value = 0
End Sub

Private Sub Timer_Timer()
If LoadingBar.Value < 50 Then
  LoadingBar.Value = LoadingBar.Value + 1
Else
   Timer.Enabled = False
   frmMain.Visible = True
   Unload Me
End If
End Sub
0
 

Author Comment

by:figjus
ID: 8052213
Well all I want to do is: when user is on the other form he can't by all means select the main until he cancels the about. who do i give credit for this????
0
 

Author Comment

by:figjus
ID: 8052218
Thank you vinnyd79, I guess credit goes to you, but could you help me with this other problem? Thank You.
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052233
I suggest making the about form NOT a child and set it as model:  frmAbout.Show 1

whatever you think for points, doesn't matter to me
0
 

Author Comment

by:figjus
ID: 8052295
DeAn I apreeciate that, it worked as I wanted. Anyway I'll give points to vinnyd79 because of the code he gave me. Sure more work.
Thank all anyway, Thanks really!
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052302
I agree with DeAn. You might want to set frmAbout's StartUpPosition property to "CenterOwner" as well.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

771 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