Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2009
    Posts
    4

    Unanswered: Displaying record #s on a continuous form

    Hi all...

    I'm trying to figure out how to display a record number on a continuous form. My form is based off of a filtered query, and i'd basically just like to display the "Record #_ of _" that would normally appear on the bottom of the form, but on each record on the form.

    I'd imagine this is easily do-able, but Im having a hard time figuring it out.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Don't.

    If the sort order changes, so will the record number. Best is to identify records by an ID not by a record number.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jul 2009
    Posts
    4
    if the sort order changes, and the on-form record number changes, i'm fine with that. Honestly the continuous form will rarely be displaying more than a handful of records, so i'm just trying to use the on screen "Record #_ of _" as an easy way of identifying the record.

    I am able to create a field that displays the record # by using a Me.CurrentRecord statement, however the problem is that the field is repeated for every record on the continuous form, and for each one only returns the record that you are currently in.

    For example, if the form shows 5 records, and I am currently editing record #2, the field on each record shows "2". I would like the field to say 1, 2, 3, 4, or 5 for each record displayed.


    Anyone?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Ok, let me put it to you another way. You can't. Identify records by their ID, not by record numbers.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I'm sure there is some long-winded way of doing it, but there is just no reason to bother when you can just use an ID.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jul 2009
    Posts
    4
    The problem with that is that i'm using a database of thousands of records, and my form is displaying a query of that database only returning a handful of records. It is USELESS to me for my form to show "records #456, 489, and 612" from the database. What IS useful is if I can show "records #1, 2, and 3" which are returned by the query. Just like the record navigation fields do on the bottom of the form. Understand?

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yes we understand, but what you are trying to do is not possible using continuous forms and bound controls

    it may be possible to create a control and populate it programatically. I forget if you can use unbound controls in continuous forms.

    I suspect you are going to have to rethink your design.
    can you not use the rows primary key or some hash of that
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If you're using a query as the recordsource for your form the navigation bar at the bottom of your form should be showing Record X of N records where these numbers should represent the records returned by your query, not the total records in the underlying table/database. Is it not doing this?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    It is USELESS to me for my form to show "records #456, 489, and 612" from the database.
    Other than being the only way to identify records?

    It is not USELESS, it is just not what you want. It's use is quite clear.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    Jan 2010
    Posts
    1
    I had the same query as TonyHall, (the reason for needing row numbers is irrelevant) and came across this solution which worked for me:

    Row numbers and alternate colors to a Continuous Form - .NET Framework insights

Posting Permissions

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