Results 1 to 7 of 7

Determine row number in sub form

  1. #1
    odb2012 is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2012
    Posts
    5

    Determine row number in sub form

    Hi,



    Is there a way to determine the row number of the active record in a sub form?

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    6,948
    look at the record navigation index, bottom left corner.
    tells the rec#, and the total recs shown.

  3. #3
    odb2012 is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Sorry, should have been more specific.
    I'm trying to accomplish this in an On change event of a control in the sub form. Which I figured out.
    I found a problem I have a tab with 2 sub forms, when I use a test script:

    (Personnel sub form)
    Private Sub WOJoinPer_PerID_Change()
    If (Me.CurrentRecord = 1) Then
    MsgBox ("Record 1")
    End If
    End Sub

    (Test sub form)
    Private Sub WOJoinTest_TestID_Change()
    If (Me.CurrentRecord = 1) Then
    MsgBox ("Record 1")
    End If
    End Sub

    It works in Test sub form but I get this error in the Personnel sub form.
    "The expression On Change you entered as the event property setting produced the following error: Object or class does not support the set of events."
    Any thoughts on why I get the error?

  4. #4
    odb2012 is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2012
    Posts
    5
    Fixed.
    I copied all the controls to a new form and it worked with out the error.

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    7,793
    You might want to read this

    What, no record numbers?
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  6. #6
    kevinjoseph is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2018
    Posts
    1
    I always want to start at 1 and be numbered sequentially. If I can get at the sub-form row number I can simply set TableB.Column2 to that value.

  7. #7
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    2,471
    See this link to my website where I explain how to add rank order in queries. http://www.mendipdatasystems.co.uk/r...ies/4594424063
    However you really don't need that here
    For the purpose you described in your last post, you would just reference the primary key field for that record
    Colin (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

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

Similar Threads

  1. Determine day number in a year
    By shod90 in forum Forms
    Replies: 4
    Last Post: 11-07-2017, 02:08 AM
  2. Replies: 0
    Last Post: 03-28-2016, 07:00 AM
  3. Replies: 3
    Last Post: 12-24-2015, 01:48 PM
  4. Replies: 3
    Last Post: 05-27-2015, 12:17 PM
  5. Function to Determine Number of Workdays Error
    By McArthurGDM in forum Modules
    Replies: 3
    Last Post: 12-08-2014, 01:51 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
  •  
Tech Forums: Microsoft Office Forums