Results 1 to 2 of 2

Thread: current record

  1. #1
    Pete Forde Guest

    current record

    After looking at the documentation I'm still feeling unclear as to how to retrieve the current record number. All of the session variables I've tried don't seem to return the correct number.

    Pete

  2. #2
    John Guest

    current record (reply)

    Hi Pete,

    The reason you don't see a current record number documented is that the record number is never absolute. What might be record #123 today might be #124 in a minute or two. Similarly, depending on your "filter" it will usually change too.

    Therefore, you have to think in terms of defining a unique KEY to get any record back. Access suggests an Autonumber field that it will generate to make each record unique. It's usually named "ID". Using that field's value, you can always retrieve any record you wish with a simple dbSQL such as:

    IDnumber=123
    X.dbSQL = "SELECT * FROM myTable WHERE ID=" & IDnumber

    Normally your IDnumber would come from a dbMagicCell, or something, but the point is that you'll always get that record when you use its ID.

    This is exactly the principle behind the powerful Drill-Down example at:

    http://www.aspdb.com/apps/mh-drill-down.asp

    Check it out (along with the other examples) to see how this works.

    Thanks,
    John


    ------------
    Pete Forde at 7/29/99 11:49:36 PM

    After looking at the documentation I'm still feeling unclear as to how to retrieve the current record number. All of the session variables I've tried don't seem to return the correct number.

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •