Results 1 to 2 of 2
  1. #1
    ntambomvu is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Johannesburg south africa
    Posts
    91

    report to list records 100 at a time

    Hello Everyone-
    I am a novice programmer and trying my best.
    thanks for the interaction- it is a great help when you chaps
    are able to suggest solutions to problems that are not in the tutorials.
    I have a stores table with 6000 records.
    I am wanting to audit the contents of every store item. ( each item has its own
    record in the table.)
    Time constraints mean that i can only audit 100 records at a time so I want my report
    to print out 100 records only.
    I think that It would be nice to say to the report -" please print out record numbers between
    101 and 200 " next time i will sat from 201 to 300 and so on.
    Please give me suggestions as to how this could be easily done. ( maybe i need some
    criteria in the query- or is there another way.


    I dont fully understand the VBA coding yet - so a solution that can use the design
    view interface would be easy for me

    Best regards

    fred evans from south africa

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    investigate using the TOP predicate in SQL e.g.

    first 100 - SELECT TOP 100 * FROM myTable ORDER BY ID

    second 100 - SELECT TOP 100 * FROM myTable WHERE ID NOT IN (SELECT TOP 100 * FROM myTable ORDER BY ID) ORDER BY ID

    third 100 - SELECT TOP 100 * FROM myTable WHERE ID NOT IN (SELECT TOP 200 * FROM myTable ORDER BY ID) ORDER BY ID

    ORDER BY is important because data is stored randomly. Without it, the same query might return different results each time it is run after updates have been made to the table

    An alternative might be

    SELECT * FROM myTable WHERE (SELECT Count(*) FROM myTable T WHERE ID<=myTable.ID) BETWEEN [Enter A Start number] AND [Enter a Start number]+99

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

Similar Threads

  1. Replies: 3
    Last Post: 05-21-2015, 09:11 AM
  2. Replies: 16
    Last Post: 10-12-2014, 01:27 PM
  3. Replies: 6
    Last Post: 06-28-2014, 07:45 PM
  4. Replies: 15
    Last Post: 11-20-2013, 04:30 PM
  5. Replies: 3
    Last Post: 03-25-2010, 12:31 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