473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

timer , delay in VBA

553 512MB
How to set a delay between 2 statements.

If i want to put a delay b/w 2 commands, e.g

Open Form

Wait 1 min

Close form


Help please?

Thanks
Jul 20 '07 #1
3 9103
JKing
1,206 Expert 1GB
All forms have an On_Timer event and a property called TimerInterval that you can set to accomplish this.

TimerInterval specifies the time in miliseconds that the form should wait before executing the On_Timer event code. Setting the TimerInterval programmatically or through the properties window to 60000 would cause the form to wait 1 minute before firing off the event. If you just want to close the form in the event it would simply be.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.     DoCmd.Close
  3. End Sub
  4.  
Jul 20 '07 #2
questionit
553 512MB
JKing
and how would i set timer between 2 statements
e,.g

statement 1 - does something

delay

statemen 2 - does something

All forms have an On_Timer event and a property called TimerInterval that you can set to accomplish this.

TimerInterval specifies the time in miliseconds that the form should wait before executing the On_Timer event code. Setting the TimerInterval programmatically or through the properties window to 60000 would cause the form to wait 1 minute before firing off the event. If you just want to close the form in the event it would simply be.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.     DoCmd.Close
  3. End Sub
  4.  
Jul 20 '07 #3
JKing
1,206 Expert 1GB
It would be something like:

First event
Statement 1 happens
Set TimerInterval = 1000

Timer event
Statement 2 happens
Set TimerInterval = 0
Jul 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Geoff | last post by:
Hey.. I'm having problems with stopping this timer from outside the 'runTimer()' class.. i have no problems calling 'cancel()' from inside the run() method but I want to be able to stop the Timer...
2
by: lynology | last post by:
My program takes in a key pressed value from the main routine and based on the key pressed, it selects the command to be executed. The problem I have is in creating a delay timer so that a message...
1
by: lynology | last post by:
My program takes in a key pressed value from the main routine and based on the key pressed, it selects the command to be executed. The problem I have is in creating a delay timer so that a message...
3
by: ELO | last post by:
Hi all Every week, I need to get two files on a remote server. I have developped a C# Windows Service with two System.Threading.Timer to do this task For the first one, the delay (TimeSpan...
4
by: vinay | last post by:
Hi, I need to use a Timer at run time. I have created a Timer class which has method 'CreateTimer'. I am able to create a timer and run the associated event (code snippet follows), but I am...
5
by: joec | last post by:
I'm writing an arcade game were I need a delay for the man between steps. Also using the keyboard arrows to direct user man. Using delay at 5000 (changeable) Dim mark(15000) 'Sub DEALAYMAN:...
3
by: Steve Lowe | last post by:
Hi, I'm getting into VB.net with the help of a few books, but have got a problem grasping how to implement a system.timers.timer Only 1 of my 3 books mentions timers and that's a...
9
by: archana | last post by:
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is...
19
by: UG | last post by:
I just wanted to know whether any timer facility exists in C, as it is not mentioned in K&R 2, or in the ISO Draft. By timer function i mean that when we use standard input function like scanf() or...
4
by: puntino | last post by:
Hi I have created my Alarm, at compile time I don't have any problem, but at run time I receive the follo wing messages: Exception in thread "main" java.lang.NullPointerException at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.