Results 1 to 6 of 6
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Me.Recordset.RecordCount Go to specific number in count

    I'm making a custom record navigation buttons and I would like to be able to type a number that jumps to that number in the number of records (note NOT the ID)



    I don't know the method to do this

    things like

    Form.Recordset.MoveNext

    work fine

    however

    I want Form.Recordset.gotonumber = 55

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    absolute position worked

    however it was going one number in front so I had to


    do
    Code:
    If IsNumeric(Trim(Me.Text_RecordsNum.Text)) = True Then
    If CLng(Trim(Me.Text_RecordsNum.Text)) < Me.Recordset.RecordCount Then
    Me.Recordset.AbsolutePosition = CLng(Trim(Me.Text_RecordsNum.Text)) - 1
    End If
    End If

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    updated

    Code:
    If IsNumeric(Trim(Me.Text_RecordsNum.Text)) = True Then
    If CLng(Trim(Me.Text_RecordsNum.Text)) <= Me.Recordset.RecordCount And CLng(Trim(Me.Text_RecordsNum.Text)) <> 0 Then
    Me.Recordset.AbsolutePosition = CLng(Trim(Me.Text_RecordsNum.Text)) - 1
    Me.Text_RecordsNum.Value = Me.CurrentRecord & " to " & Me.Recordset.RecordCount
    Else
    Me.Text_RecordsNum.Value = Me.CurrentRecord & " to " & Me.Recordset.RecordCount
    End If
    End If

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Glad you have it working.

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    thanks orange

    been a busy day - forgot to thank you

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

Similar Threads

  1. Count the number of a group in a recordset
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 05-22-2014, 10:41 PM
  2. Count of specific number
    By samirmehta19 in forum Access
    Replies: 3
    Last Post: 05-20-2013, 02:29 PM
  3. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  4. Replies: 5
    Last Post: 09-14-2012, 04:56 PM
  5. Replies: 6
    Last Post: 07-25-2011, 01:54 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