Splash screen while other form loads in background on startup (1 Viewer)

driver7408

Registered User.
Local time
Today, 12:22
Joined
Feb 7, 2010
Messages
72
I have on very large form in my db that takes several seconds to load. I want to optimize things, so I am trying to have it load hidden in the background when the db first starts up, this way it can be immediately called on when it is needed later. Please read further :

I want to have a splash screen that loads as well. I have set the splash screen to the default form when the database opens. However, I am not quite sure how to get the other form to load in the background as hidden, AFTER the splash screen opens and appears. I tried calling it with the oncurrent event of the splash screen, but then splash screen wont appear until after the other (hidden) form has finished loading. I have tried different orders of events, but am having no luck getting the desired results.

Summary: I want the splash screen to show first, then the big form to open (hidden) in the background. The user can click on a continue button on the splash screen and then the main switchboard will open.

I know this is possible, I just cannot seem to have much luck finding anything anything after searching the internet or the forums.
 

driver7408

Registered User.
Local time
Today, 12:22
Joined
Feb 7, 2010
Messages
72
Never mind, figured it out...Had to repaint the splash screen first.

Code:
Private Sub Form_Current()
Forms!frmSplash.SetFocus
Me.Repaint
DoCmd.OpenForm "frmRAW"
Forms!frmRAW.Visible = False
Me.Label10.Visible = False
Me.Command9.Visible = True
End Sub

Label10 is a label on the splash screen that says "Loading....."
Command9 is a button on the splash screen to continue.
Very easy way to utilize a splash screen. Can docmd.close the splash screen as well after the form runs, instead of using the button.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 05:22
Joined
Jan 20, 2009
Messages
12,852
Have you looked at why your form is so slow to load?
 

driver7408

Registered User.
Local time
Today, 12:22
Joined
Feb 7, 2010
Messages
72
Have you looked at why your form is so slow to load?

It is a very large form with 3 1:1 tables, several subforms, calculated fields, and queries that pull some information from another database. It is used only to generate several temporary variables that are printed out on a paper form, and then deleted at the end of the week.
 

JoeyT7

New member
Local time
Today, 15:22
Joined
May 12, 2020
Messages
1
Hey driver7408, I am also trying to load a table while a splash screen shows but I cannot get the splash screen to show before the table starts to load. I used your Me.Repaint method and it did not seem to work:

Private Sub Form_Current()

Me.Repaint
CreateTempTable 'Creates a temp tables that takes a while to load

End Sub

Any help with getting the splash screen to display first and then load the table?
My splash screen opens up automatically when the file is open
 

Micron

AWF VIP
Local time
Today, 15:22
Joined
Oct 20, 2018
Messages
3,478
Did you notice that you're asking for help from someone who started this thread 6 years ago?
To get a splash screen to work properly (from my experience anyway) requires you to have a bitmap in the same folder as the db. The bitmap should have the same name as the db (e.g. CustomersDb > CustomersDb.bmp). This suppresses the application startup screen. At least that's how it was the last time I created a splash screen so maybe that no longer applies. You can also make a popup form resembling a splash screen, open that, and close it with a timer function to get a delay.
 

Isaac

Lifelong Learner
Local time
Today, 12:22
Joined
Mar 14, 2017
Messages
8,777
Hey @driver7408, I am also trying to load a table while a splash screen shows but I cannot get the splash screen to show before the table starts to load. I used your Me.Repaint method and it did not seem to work:

Private Sub Form_Current()

Me.Repaint
CreateTempTable 'Creates a temp tables that takes a while to load

End Sub

Any help with getting the splash screen to display first and then load the table?
My splash screen opens up automatically when the file is open
I'm not sure whether I've ever tried to initiate a long-running process on my databases' initial startup form (splash screen), but you might try this and see if it has any positive effect on your particular situation.

Goes in a regular Module of your database:
Code:
Sub MakeCodeWait(strSeconds As String)
Dim dtTime As Date
dtTime = Now
Do Until Now >= dtTime + TimeValue("00:00:0" & strSeconds)
    DoEvents
Loop
End Sub

Your new code:
Code:
Private Sub Form_Current()

Me.Repaint
MakeCodeWait "3"  'wait 3 seconds before starting your other process
CreateTempTable 'Creates a temp tables that takes a while to load

End Sub

Granted, the wait code will cause the application to essentially freeze and do nothing, but there's a possibility your form may come out of it looking more like you want it to before starting the other process..... Not sure.
 

isladogs

MVP / VIP
Local time
Today, 20:22
Joined
Jan 14, 2017
Messages
18,219
Agree with Micron's earlier reply.
1. You can suppress the Access splash screen by having a bmp file with the same name as your app in the same folder
2. The startup form should always be designed so it loads quickly, otherwise user experience will be poor,
3. If you have another form you want to load that is much slower, do so by using a timer event on your (quick) start-up form so it is only opened after your start-up form has fully loaded. Use the same event code to reset the timer interval to zero so the event only occurs once.

I wouldn't recommend using the Form_Current event
 

Isaac

Lifelong Learner
Local time
Today, 12:22
Joined
Mar 14, 2017
Messages
8,777
Without commenting on splash screens via picture files, I have to agree that the other gents' Timer solution is the one to go with...Not what I posted which pauses code execution. Much better. :)
 

Micron

AWF VIP
Local time
Today, 15:22
Joined
Oct 20, 2018
Messages
3,478
I forgot to mention that the startup bitmap doesn't have to be more than a single pixel image in order to suppress the application startup screen, but if you're going to show a fancy startup app splash screen, might as well go whole hog and show the app name, logo(s), etc. right?
 

Users who are viewing this thread

Top Bottom