473,382 Members | 1,611 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,382 software developers and data experts.

Timer Event

1
Does anyone know how to create a timer on a form that allows a user to view a string of characters for a specified period of time (5 seconds or so) and then hide it?

I'm trying to add code to the click event of a button so either a label or text box appears and then hides after 5 seconds. I don't know where to even begin as I am quite new at this VBA programming.

Any suggestions?

Thanks in advance.
Mar 18 '08 #1
1 7842
ADezii
8,834 Expert 8TB
Does anyone know how to create a timer on a form that allows a user to view a string of characters for a specified period of time (5 seconds or so) and then hide it?

I'm trying to add code to the click event of a button so either a label or text box appears and then hides after 5 seconds. I don't know where to even begin as I am quite new at this VBA programming.

Any suggestions?

Thanks in advance.
  1. Create a Text Box on your Form and name it txtTest.
  2. Create a Command Button on your Form and name it cmdTest.
  3. Make sure the Timer Interval Property of your Form = 0.
  4. Copy and Paste the following code to the Click() Event of cmdTest:
    Expand|Select|Wrap|Line Numbers
    1. Me![txtTest].Visible = True     'make Text Box invisible
    2. Me.TimerInterval = 5000         'set Timer Interval to 5 seconds
  5. Copy and Paste the following code to the Timer() Event of your Form:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Timer()
    2.   Me![txtTest].Visible = False      'make the Text Box invisible after 5 secs
    3.   Me.TimerInterval = 0              'disable the Timer
    4. End Sub
  6. When you click the Command Button (cmdTest), the Text Box and any text within it will be visible for 5 seconds then disappear. Clicking again on the Command Button will repeat the process.
  7. You can just as easily use a Label Controlo instead of a Text Box.
Mar 18 '08 #2

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

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
3
by: Peter Johnsson | last post by:
How come the eventhandler for the timer's elapsed time event is called over and over again, even though the AutoReset property is set to false, if you assign a new value to the timer objects...
8
by: Daniel P. | last post by:
I'm trying to set a timer that gets called every 3 seconds so I can update a field in the UI with the time elapsed since the process started. What am I doing wrong that timerDF_Tick does not get...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
7
by: Grahmmer | last post by:
I have a few timers that are added to a form at runtime. I can handle the event fine, but I cannot identify which timer fired. Is there a way to do this? Timer Creation: -------------...
10
by: Bob | last post by:
I have a splashscreen running on a thread from Sub Main and it works OK. It displays information in a statusbar about queries. I also have a time on the splashscreen, but the tick event never...
11
by: Philip Wagenaar | last post by:
Hello, I am using a timer object in my Windows Forms Application. Does the code in ..elapsed event run in a diffrent thread? If the interval is set to 10 milliseconds and the time to execute the...
7
by: RobKinney1 | last post by:
Hello, Wow...I have one for you all and hopefully I am not understanding this timer object correctly. I have a timer setup that pulses a connection through a socket every 60 seconds. But it...
4
by: Boki | last post by:
Hi All, I have a timer, if my data queue Q has data, the timer should start work, if there is no data in Q, the timer should stop. However, there is an event can fire timer to start. Should I...
3
by: Steve | last post by:
Hi All I am using VB.net 2008 and use timer controls within my applications Question Does the code in a Timer control.tick event run on a different thread to the main Application thread (UI...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.