Solved

Using the Time Interval property in Access to display several objects on a form?

Posted on 2004-09-29
4
698 Views
Last Modified: 2012-06-21
Hi,

I am trying to display 5 labels on an Access form, separated by a time interval of one second.
I have each of the letters F , L, Y, I, N,G in seprate labels. The VB code in the current event  of the form hide these labels (visible = false). I need to have each of them visible after the form is loaded with a one second time interval between each label.
I tried setting the Time Interval property of the form to 1000, and in the Form_Time event I had each label set to visible = true, but they all show at once. I tried using the Timer with not much luck.
0
Comment
Question by:tariqanis
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 12179788
Hello tariqanis,

What happens after all letters are visible?
Do they all stay visible or does it all start again?

Pete
0
 

Author Comment

by:tariqanis
ID: 12179975
Hi Pete,

The letters stay visible... and that's ok, I want them to stay visible, but what I don't want is for them to become visible all at once, I need to have their appearance separated by a one second interval...
0
 
LVL 5

Accepted Solution

by:
jmacmicking earned 250 total points
ID: 12180069
First, create a global counter variable.  Just DIM an integer outside of all other functions for this (I suggest something like DIM CurrentLabel as Integer).  Now, in the Form_Time event put a Select Case statement.  Create one case for each label.  In the case make the label visible and then increment the counter.  Sample code follows.

Labels:
LabelF : Visible = True
LabelL : Visible = False
LabelY : Visible = False
LabelI : Visible = False
LabelN : Visible = False
LabelG : Visible = False

Dim CurrentLabel as Integer

Sub Form_Time
    If CurrentLabel > 4 Then
        Me.TimerInterval = 0
        Exit Sub
    End If

    Select Case CurrentLabel
        Case 4:
            LabelG.Visible = True
            CurrentLabel = CurrentLabel + 1
        Case 3:
            LabelN.Visible = True
            CurrentLabel = CurrentLabel + 1
        Case 2:
            LabelI.Visible = True
            CurrentLabel = CurrentLabel + 1
        Case 1:
            LabelY.Visible = True
            CurrentLabel = CurrentLabel + 1
        Case 0:
            LabelL.Visible = True
            CurrentLabel = CurrentLabel + 1
    End Select
End Sub
0
 

Author Comment

by:tariqanis
ID: 12180504
Thanks jmacmicking,

It works like a charm
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

680 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