Results 1 to 7 of 7
  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 offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    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
    9,664
    You might want to read this

    What, no record numbers?

  6. #6
    kevinjoseph is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2018
    Posts
    3
    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
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    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, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

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