+ Reply to Thread
Results 1 to 2 of 2

Thread: Display data in record order.

  1. #1
    Registered User
    Join Date
    12-04-2005
    Posts
    17

    Display data in record order.

    I've updated from Office Pro for XP to Office 2007, opened my old database and saved in new format.
    Records saved as 'Ref' which is the primary key. When opening a form in 2002 to display data, the first record displayed was 1 followed by 2 etc. Buttons would select 'First' Last' 'Next' 'Previous.'
    In 2007 the same happens, except if a new record is created and the form opened, that new record is displayed first, not record 1.
    So, in Access 2002 if records were numbered 1 to 20 they would be displayed automatically 1, 2, 3 etc., but now with say 2 new records created i.e. 1 - 22
    the display order is 21, 22, 1, 2, 3 etc.
    How do I rectify this to display records in Ref order 1 to 22?
    Hope someone can help. Regards - John

  2. #2
    Forum Administrator
    Join Date
    03-17-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Display data in record order.

    Try this code it will help you.

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
        Dim cell As Range
        Dim OldText As String, NewText As String
        
      If Sheets("Sheet1").Range("Z1").Value = 1 Then
        For Each cell In Target
            With cell
                On Error Resume Next
                OldText = .Comment.Text
                If Err <> 0 Then .AddComment
                NewText = OldText & "Changed to " & cell.Text & _
                  " by " & Cells(1, 2) & " at " & Now & vbLf
                .Comment.Text NewText
                .Comment.Visible = True
                .Comment.Shape.Select
                 Selection.AutoSize = True
                .Comment.Visible = False
            End With
        Next cell
      End If
    End Sub
    Attached Files Attached Files
    ExlGuru

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0