Results 1 to 5 of 5
  1. #1
    snorkyller is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    16

    Alternative to AbsolutePosition?

    Which is the best method to know, in the code, the actual position of the record showed by a form? For example if there are 12 records and the form is actually displaying the 3rd record, I need to get the number 3.



    Me.Recordset.AbsolutePosition doesn't seem a good solution 'cause it is often equal to -1. For example, after deleting a record or modifying the .RecordSource property of the form. This lead to errors. Even after moving the current record with DoCmd.GoToRecord, .AbsolutePosition sometimes stay to -1. So it is sometimes impossible to know in the Form_Current event what is the current record.

    Thank you for your suggestions...
    Last edited by snorkyller; 03-04-2011 at 12:20 PM.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    if you make the navigation button visible on forms, you can read it right off of the screen.

  3. #3
    snorkyller is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    16
    Quote Originally Posted by ajetrumpet View Post
    if you make the navigation button visible on forms, you can read it right off of the screen.
    (?!)
    I know that!
    It's in the code that need to know the current record number.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    the code to get the record number in a form is simply:
    Code:
    me.currentrecord

  5. #5
    snorkyller is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    16
    Yeah very simple! I wonder why I didn't find it before. I was using Me.Recordset.AbsolutePosition...

    I wish it doesn't also return -1 sometimes...

    Thanks a lot!

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

Similar Threads

  1. Trunc alternative in Access
    By blazixinfo@yahoo.com in forum Queries
    Replies: 3
    Last Post: 12-11-2009, 01:54 PM
  2. Alternative to Join Property???
    By arthura in forum Queries
    Replies: 1
    Last Post: 05-22-2009, 12:17 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