Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a request to implement some kind of row number for some reports and other things, and i am trying to figure out an easy way to do this that does not require inserting or creating some kind of autonumber field to a table. what i have in mind is, in a query, create a virtual column that does the same thing autonumber does without actually having to append an autonumber field. i think this might come in handy and am curious as to if this is possible. sure would be nice!

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Your question asks about adding it to a query, but your post talks about doing it for reports.
    It can be done much more efficiently on reports, without doing it in the query.

    Thread beginning tells you how to do it with a report.
    Regards
    John



  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need to have the number display in a subform and the same number should appear in the report, so i can't escape the idea of a virtual autonumber column in the source table. Also, i am not adding or deleting rows, so I don't need a function that increments on new entries.

    I feel like i should be able to tap into Access's native assignment of a row number that you see in the navigation scroller. that would be dead easy! Maybe.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    There is no equivalent for Forms of the method that is used for Reports. The most efficient thing would be to have a field in the table. But it can't be an autonumber, as they increment across the whole table, not within groups.

    To do it with a query look at these examples from Rogers access library .
    Regards
    John



  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Quote Originally Posted by steve_skelton13 View Post
    I feel like i should be able to tap into Access's native assignment of a row number that you see in the navigation scroller. that would be dead easy! Maybe.
    You could probably do that sort of thing with an unbound subform, but unbound subforms are a nightmare. And the real issue is that your user will then demand that row number 6 last week be row number 6 this week and next as well. Anytime I've tried to do this sort of thing, I've regretted it. On the other hand a sequence number on a report is a useful thing if two people are trying to compare the same report over the phone or by video conference or such. My advice is to either add a number to the table, or tell the user it can't be done.
    Wendell

Posting Permissions

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