Results 1 to 5 of 5
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

    TimerInterval in Form

    Hello guys
    I have used this code for the purpose of the appearance of the text boxes sequentially, but it did not work.
    any help
    thank you
    Code:
    Private Sub Form_Timer()
                If Me.TimerInterval = 1000 Then
                   Me.txtTimer.Visible = True
    
    
                ElseIf Me.TimerInterval = 3000 Then
                    Me.txtTimer1.Visible = True
    
    
                ElseIf Me.TimerInterval = 5000 Then
                    Me.txtTimer2.Visible = True
    
    
                End If
    
    
    End Sub


  2. #2
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    It should work, but havent tested it myself,

    On one of my forms i do it this way though :

    Paste this in a module :

    Code:
    '***************** Code Start *******************
    ' This code was originally written by Dev Ashish.
    ' It is not to be altered or distributed,
    ' except as part of an application.
    ' You are free to use it in any application,
    ' provided the copyright notice is left unchanged.
    '
    ' Code Courtesy of
    ' Dev Ashish
    '
    Private Declare Sub sapiSleep Lib "kernel32" _
            Alias "Sleep" _
            (ByVal dwMilliseconds As Long)
    
    
    Sub sSleep(lngMilliSec As Long)
        If lngMilliSec > 0 Then
            Call sapiSleep(lngMilliSec)
        End If
    End Sub
    
    
    
    
    '***************** Code End *********************
    then use this on the form_timer event :

    Code:
    Const cTIME = 1000 'in MilliSeconds
    
    
    Me.text1.Visible = True
    
    
    Call sSleep(cTIME)
    
    
    Me.text2.Visible = True
    Const cTIME = 2000 'in MilliSeconds
    
    'and so on
    By setting the cTime to different values between the textboxes you can specify what time is between them for the textboxes
    to appear.

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    TimerInterval is a property of the form. It does not change unless you change it. Sounds like you want to test for the passage of time, which your code will not do.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As Paul said, TimerInterval is a Form Property that you set...not an elapsed time that can be Read. This is the kind of thing you need, assuming that you want each Control to become visible, in turn, after 1, 3 and 5 seconds have elapsed.
    Code:
    Private Sub Form_Load()
     Me.TimerInterval = 1000 'Timer Event will fire every Second
    End Sub
    
    Private Sub Form_Timer()
    
    Static intCount As Integer
     
    intCount = intCount + 1
      
      Select Case intCount
    
       Case 1 '1 second has passed
      
        Me.txtTimer.Visible = True
    
       Case 3  '3 seconds have passed
        
        Me.txtTimer1.Visible = True
    
        Case 5  '5 seconds have passed
         
         Me.txtTimer2.Visible = True
         
         intCount = 0
    
      End Select
                
    End Sub

    For this to work, the Visible Properties of each Control will have to originally be set to False/No, of course. And depending on your exact scenario, you may have to tweak this. You haven't said whether you want this to only happen when the Form originally opens, or each time a New Record is created, or what, exactly.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Unfortunately, the delayed response
    Thank you so much you guys

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2009, 09:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums