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
Solved

Time a form to only show for 5 seconds

Posted on 2012-03-14
4
316 Views
Last Modified: 2012-03-14
I know there is a timer event, but when the main form opens, I want it to only show for 5 seconds and then kick off a process, but can this be done in the form open event?

Private Sub Form_Open(Cancel As Integer)
    strUserId = VBUserName
       
'STOP HERE FOR FIVE SECONDS BEFORE CALLING THE PROCESS


    Call lblLMRDatabases_Click
End Sub
0
Comment
Question by:ssmith94015
  • 2
4 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 37721631
Set the timer interval to 5000

and add this to the On Timer event

Docmd.close acform, me.name
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37721642
Actually if you need to start the process after the 5 seconds, place both lines of code in the Timer event, not the Open Event:



    Call lblLMRDatabases_Click
   Docmd.close acform, me.name
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37721647
first you need to add this line in one of your regular modules

option explicit

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)



Private Sub Form_Open(Cancel As Integer)
    strUserId = VBUserName
       
'STOP HERE FOR FIVE SECONDS BEFORE CALLING THE PROCESS

Sleep 5000

    Call lblLMRDatabases_Click
End Su
0
 

Author Closing Comment

by:ssmith94015
ID: 37721691
This is the version I went with.

Sandra
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

792 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