Solved

Scroll to First Record in the Form

Posted on 2011-09-15
2
252 Views
Last Modified: 2012-05-12
I use a form to update attendance records. When the records are complete for the day I have a button that appends these records to a table. The scroll bar after the last record is complete is at the bottom of the form on one of the last few records. What code can I add to the button that performs the append to set the scroll bar position at the first record? When I open the form the scroll bar is always on the first record. After I click the button the scroll bar stays on the last few records. Code for the "On Click" property of the button is attached. Thanks
Private Sub cmdqraAttendance_Click()
On Error GoTo Err_cmdqraAttendance_Click

    Dim stDocName As String
    Dim AttDate As Date
    
    Me.Refresh
    
    'Turn Hourglass On
    DoCmd.Hourglass True
    'Turn Warnings Off
    DoCmd.SetWarnings False

    'Append records to tblAttendance
    stDocName = "qraAttendance"
    DoCmd.OpenQuery stDocName, acNormal, acEdit
    'Clear tblEmployees
    stDocName = "qrupdEmployees"
    DoCmd.OpenQuery stDocName, acNormal, acEdit
    
    AttDate = Me.txtAttDate + 1
    Me.txtAttDate = AttDate
    
    MsgBox "Attendance Updated"
    
    'Turn Hourglass Off
    DoCmd.Hourglass False
    'Turn Warnings On
    DoCmd.SetWarnings True
    
    Me.SetFocus

Exit_cmdqraAttendance_Click:
    Exit Sub

Err_cmdqraAttendance_Click:
    MsgBox Err.Description
    Resume Exit_cmdqraAttendance_Click
    
End Sub

Open in new window

0
Comment
Question by:StampIT
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 36542903


  MsgBox "Attendance Updated"


docmd.GoToRecord ,,acFirst     'add this line


0
 

Author Closing Comment

by:StampIT
ID: 36543182
Thanks for the quick and accurate response.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now