469,280 Members | 2,053 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

On Timer Event

Can some one tell me the code required to do the following:

When my form called Welcome opens I want one text field to be visible
for 5 seconds, then i want to make another field visible for 5 seconds
makeing text field 1 invisible. After these 10 seconds, I want to
close the form.

Any help would be greatly appreciated.

Regards,
Chris

Jan 22 '07 #1
4 26890
Baz
I'm intrigued. Why?

Anyway, set the form's TimerInterval to 5000 in the property sheet, and put
this code in the Timer event:

Private Sub Form_Timer()

If Text1.Visible Then
Text1.Visible = False
Text2.Visible = True
Else
DoCmd.Close acForm, Me.Name
End If

End Sub

"chris" <ch**********@yahoo.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
Can some one tell me the code required to do the following:

When my form called Welcome opens I want one text field to be visible
for 5 seconds, then i want to make another field visible for 5 seconds
makeing text field 1 invisible. After these 10 seconds, I want to
close the form.

Any help would be greatly appreciated.

Regards,
Chris

Jan 22 '07 #2
On 22 Jan 2007 10:30:46 -0800, chris wrote:
Can some one tell me the code required to do the following:

When my form called Welcome opens I want one text field to be visible
for 5 seconds, then i want to make another field visible for 5 seconds
makeing text field 1 invisible. After these 10 seconds, I want to
close the form.

Any help would be greatly appreciated.

Regards,
Chris
Here's all the code you need.

Set the [Control2] Visible property to No first.
Set the Time Interval to 1000

Option Compare Database
Option Explicit
Dim dteTime As Date

Private Sub Form_Open(Cancel As Integer)
dteTime = Time()
End Sub
============
Private Sub Form_Timer()
If DateDiff("s", dteTime, Time()) >= 5 Then
Me![Control1].Visible = False
Me![Control2].Visible = True
End If

If DateDiff("s", dteTime, Time()) >= 10 Then
DoCmd.Close acForm, Me.Name
End If

End Sub

Change [Control1] and [Control2] to whatever the names of the controls
are. You can leave Me.Name as is to close the Welcome form.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jan 22 '07 #3
Excellent! That worked great! Thank you!

The reason - I'm creating the illusion that the program is loading and
then checking security. I don't really need it, but I like the effect.

Thanks again!
Baz wrote:
I'm intrigued. Why?

Anyway, set the form's TimerInterval to 5000 in the property sheet, and put
this code in the Timer event:

Private Sub Form_Timer()

If Text1.Visible Then
Text1.Visible = False
Text2.Visible = True
Else
DoCmd.Close acForm, Me.Name
End If

End Sub

"chris" <ch**********@yahoo.comwrote in message
news:11**********************@a75g2000cwd.googlegr oups.com...
Can some one tell me the code required to do the following:

When my form called Welcome opens I want one text field to be visible
for 5 seconds, then i want to make another field visible for 5 seconds
makeing text field 1 invisible. After these 10 seconds, I want to
close the form.

Any help would be greatly appreciated.

Regards,
Chris
Jan 22 '07 #4
Actually, Baz's code works fine and only involves one sub routine. Fredg's
solution adds an unneeded line in the Form_Open sub, and would only show each
message for one second. In TimerInterval the value needs to be 1000 for each
second desired.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200701/1

Jan 23 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mr. B | last post: by
10 posts views Thread by Wayne Aprato | last post: by
5 posts views Thread by caulker | last post: by
9 posts views Thread by Tolga Tanriverdi | last post: by
1 post views Thread by BC | last post: by
7 posts views Thread by =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post: by
2 posts views Thread by Salad | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.