You are currently offline, waiting for your internet to reconnect

ADT/ODE: How to Create a Custom Startup "Splash" Screen

This article was previously published under Q101374
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Advanced: Requires expert coding, interoperability, and multiuser skills.

SUMMARY
This article explains how to create a custom startup "splash" screen(title screen) for your Microsoft Access application.

This article assumes that you are familiar with Visual Basic forApplications and with creating Microsoft Access applications using theprogramming tools provided with Microsoft Access. For more informationabout Visual Basic for Applications, please refer to your version of the"Building Applications with Microsoft Access" manual.

NOTE: Visual Basic for Applications is called Access Basic in MicrosoftAccess versions 1.x and 2.0. For more information about Access Basic,please refer to the "Introduction to Programming" manual in MicrosoftAccess version 1.x or the "Building Applications" manual in MicrosoftAccess version 2.0
MORE INFORMATION
A startup "splash" screen is used by programmers to display importantinformation about a program during startup and to give the user somethingcolorful to look at and read while waiting for the program to complete itsinitial processing, such as reading and setting up user-definedpreferences.

A typical splash screen contains the following information:

  • The program name and version number
  • The registered user's name and company
  • Copyright information
  • The developer's company name and logo
This article contains two sample user-defined functions to implementsplash functionality.

Creating a New Splash Module

To create the functions, follow these steps:

  1. Create a new module, and type the following functions.

    NOTE: In the following code, an underscore (_) is used as a line- continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic.
           '******************************************************************       ' MODULE NAME: Splash       ' DECLARATION SECTION       '******************************************************************       Option Explicit       Dim gSplashStart     ' The time when the splash screen opened.       Dim gSplashInterval  ' The minimum time to leave the splash screen                            ' up.       Dim gSplashForm      ' The name of the splash screen form.       '******************************************************************       ' FUNCTION: SplashStart()       '       ' PURPOSE: Used to invoke the splash screen form specified by the       '    SplashForm argument.       '       ' ARGUMENTS:       '    SplashForm     - The name of the form to use as the splash       '                     screen.       '    SplashInterval - The minimum time, in seconds, that the splash       '                     screen must remain active on the screen.       '       '******************************************************************       Function SplashStart (ByVal SplashForm As String, ByVal _              SplashInterval As Integer)           ' Open the splash form.           DoCmd.OpenForm SplashForm  ' In Microsoft Access 97 and 7.0.           'DoCmd OpenForm SplashForm ' In versions 1.x and 2.0 only.           ' Set the starting time.           gSplashStart = Timer           ' Record the global information.           gSplashInterval = SplashInterval           gSplashForm = SplashForm       End Function       '******************************************************************       ' FUNCTION: SplashEnd()       '       ' PURPOSE: Used to close the splash screen form opened by the       '    SplashStart() function. This function checks to ensure that       '    the splash screen remains active until the user-specified       '    interval has expired.       '       '******************************************************************       Function SplashEnd ()          Dim RetVal          ' Loop until the splash screen has been active for          ' the desired interval.          Do Until Timer - gSplashStart > gSplashInterval             ' Yield control so other applications can process.             RetVal = DoEvents()          Loop          ' Close the splash screen.          DoCmd.Close acForm, gSplashForm ' In Microsoft Access 97 and 7.0.         'DoCmd Close A_FORM, gSplashForm ' In version 1.x and 2.0 only.       End Function					
  2. Save the new module as Splash.

Using the SplashStart() and SplashEnd() Functions

To use the SplashStart() and SplashEnd() functions, follow these steps:
  1. Create a form not based on any table or query with the text and graphics you want to display on the splash screen. For more information, see the "Setting Form Properties" section later in this article.
  2. In the Database window, click the Macros tab and then click New.
  3. Create a macro with the following actions and save it as AutoExec:
           Macro Name   Action       -----------------------------------------------------------------       AutoExec     RunCode                    <any startup macro actions required by your program>                    RunCode       AutoExec Actions       ----------------------------------------------------------------       RunCode          Function Name: SplashStart("YourSplashFormNameHere", 5)       <any startup macro actions required by your program .. optional>       RunCode          Function Name: SplashEnd()					

Setting Form Properties

For best results, the splash form should have its form properties set asfollows:
   ScrollBars: Neither   PopUp: Yes   Modal: Yes   RecordSelectors: No				

Suppressing the Default Splash Screen

To prevent the default Microsoft Access splash screen from appearing inversions of Microsoft Access earlier than version 7.0, you can use therun-time version of Microsoft Access provided with the Microsoft AccessDeveloper's Toolkit for version 2.0, or the Microsoft Access DistributionKit (ADK) for version 1.1.
REFERENCES
For more information about running an AutoExec macro in Microsoft Access,search the Help Index for "AutoExec macros," or ask the Microsoft Access 97Office Assistant.
title intro
Properties

Article ID: 101374 - Last Review: 05/06/2003 18:05:36 - Revision: 2.0

  • Microsoft Access Distribution Kit 1.1
  • Microsoft Access Developer's Toolkit 2.0
  • Microsoft Access Developer's Toolkit 1.1
  • Microsoft Office 97 Developer Edition
  • kbhowto kbprogramming KB101374
Feedback