Results 1 to 5 of 5
  1. #1
    JustHardWork is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    3

    Question Automatic Scroll from Topfive to Bottom in a form and start all over again

    I have a form that displays 5 records with a very big font size.


    I am looking for some code that does the following.

    The form is displayed on a giant led screen

    When opening the form i want the first 5 records displayed for 5 seconds and the move automaticly to the next five records wait five seconds and display the next five and os on and so on
    When it gets down to the bottom I want to start the process all over again.

    Any help or suggestions are very very appreciated.

    regards
    JustHardWork

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    You will need to set the form timer interval to 5000 in an appropriate event and tweak the following code in the timer event
    Code:
     If Me.CurrentRecord = Me.Recordset.RecordCount Then
                  DoCmd.GoToRecord , , acFirst
             EndIf
           If Me.CurrentRecord + 5 > Me.Recordset.RecordCount Then
                DoCmd.GoToRecord , , acLast
            Else
                DoCmd.GoToRecord , , acNext, 5
            End If

  3. #3
    JustHardWork is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    3
    Dear Amrut

    The code you prevented works fine thank you very very much.
    I tried to add some code to do the following
    After the the table is displayed 3 times I want to close the frm and open another form.
    I tried a do.until and loop but that did not work. ( but maybe i am just not good enough at this VBA stuff
    I would appriciate a suggestion very much
    x = 3
    Do Until x = 0
    If Me.CurrentRecord = Me.Recordset.RecordCount Then
    DoCmd.GoToRecord , , acFirst
    End If
    If Me.CurrentRecord + 5 > Me.Recordset.RecordCount Then
    DoCmd.GoToRecord , , acLast
    x = x - 1
    Else
    DoCmd.GoToRecord , , acNext, 5
    End If
    Loop
    DoCmd.Close
    DoCmd.OpenForm "Rounds John 2"
    End Sub

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    You will need a variable to store the no. of loops. You can use a hidden textbox on your form for this say txtLoops. Before starting the timer, set its value to zero.
    Code:
    Me.txtLoops.value=Me.txtLoops.value+1
    If Me.txtLoops.value =4 Then
    Me.TimerInterval=0
    'your code goes here
    Else
    If Me.CurrentRecord = Me.Recordset.RecordCount Then
                  DoCmd.GoToRecord , , acFirst
             End If
           If Me.CurrentRecord + 5 > Me.Recordset.RecordCount Then
                DoCmd.GoToRecord , , acLast
    Else
                DoCmd.GoToRecord , , acNext, 5
            End If
    End If
    Mark this thread as solved if this code solves your problem.

  5. #5
    JustHardWork is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2014
    Posts
    3
    Amrut Worked just fine!

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

Similar Threads

  1. White Border On Bottom of each Form
    By data808 in forum Access
    Replies: 3
    Last Post: 02-23-2014, 04:07 AM
  2. Replies: 5
    Last Post: 02-20-2014, 11:05 AM
  3. Bottom half of form not showing?
    By christm in forum Forms
    Replies: 20
    Last Post: 03-08-2013, 11:11 AM
  4. Report and automatic scroll
    By krandall in forum Reports
    Replies: 1
    Last Post: 08-02-2010, 06:27 AM
  5. can't update form-in the bottom bar of
    By ymds in forum Access
    Replies: 2
    Last Post: 07-19-2010, 06:26 AM

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