Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Yes, it was the focus. I started you off with the "Advance one Record" button code. Post back if you need further assistance.
    Attached Files Attached Files

  2. #17
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Many thanks RuralGuy,

    It's ok now, but how to I can off message table when select end of record and click next button



    I want to show order number selected record in total record ...

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Change this line:
    If .ListIndex < .ListCount Then
    ...to:
    If .ListIndex < .ListCount -1 Then
    I'm pretty sure the ListCount is 0 based.

  4. #19
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Quote Originally Posted by RuralGuy View Post
    Change this line:
    If .ListIndex < .ListCount Then
    ...to:
    If .ListIndex < .ListCount -1 Then
    I'm pretty sure the ListCount is 0 based.
    Dear RuralGuy

    I want t off message table below when select end of record and click next button
    You've used the ListIndex property incorrectly ((please see the image))

    and I want to show order number selected record in total record ... (please see the image)

  5. #20
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Close messagebox: You've used the ListIndex property incorrectly
    Change code line:

    Code:
    Err_gotoNext_Click:
       'MsgBox Err.Description
       MsgBox "End Record"
       Resume Exit_gotoNext_Click
    I want to show order number selected record in total record ... (as image below)


  6. #21
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    Goto last record in listbox access

    Code:
    Private Sub gotoLast_Click()
    
    If Me!lstItems.ListCount > 0 Then
    Me!lstItems = Me!lstItems.ItemData(Me!lstItems.ListCount - 1)
    End If
    
         
    End Sub
    First record:
    Code:
    Private Sub gotoFirst_Click()
    'Me.lstItems.Selected(0) = True
    Me.lstItems.SetFocus
    Me.lstItems.ListIndex = 0
    End Sub
    current record

    Code:
    =[lstItems].
    [ListIndex]+1
    total record:
    Code:
    ="of " & [lstItems].
    [ListCount]
    Done,
    Many thanks RuralGuy
    Last edited by uronmapu; 06-10-2012 at 07:42 AM.

  7. #22
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Thanks for sharing.

  8. #23
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    How to make a notifications when going to the last record or back to the first record

    Previous Button is ok

    Code:
    Private Sub gotoPrevious_Click()
    On Error GoTo Err_gotoPrevious_Click
        
       With Me.lstItems
          .SetFocus
          If .ListIndex < .ListCount Then
             .ListIndex = .ListIndex - 1
             MsgBox "First Contact", , "First Contact"
          End If
       End With
    Exit_gotoPrevious_Click:
       Exit Sub
    Err_gotoPrevious_Click:
       'MsgBox Err.Description
       'MsgBox "End the Record"
       Resume Exit_gotoPrevious_Click
    End Sub
    Next button not ok
    Code:
    Private Sub gotoNext_Click()
     On Error GoTo Err_gotoNext_Click
       With Me.lstItems
          .SetFocus
        If .ListIndex < .ListCount Then
            .ListIndex = .ListIndex + 1
            'MsgBox "End the Contact", , "End the Contact"
             End If
       End With
    Exit_gotoNext_Click:
       Exit Sub
    Err_gotoNext_Click:
        MsgBox Err.Description
       Resume Exit_gotoNext_Click
    End Sub

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 07-06-2013, 05:13 PM
  2. Replies: 3
    Last Post: 11-23-2011, 12:25 AM
  3. Replies: 3
    Last Post: 11-18-2011, 03:53 PM
  4. Button to Create New Record
    By Pam Buckner in forum Access
    Replies: 3
    Last Post: 10-14-2011, 09:46 AM
  5. Replies: 1
    Last Post: 07-25-2011, 09:41 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