Results 1 to 12 of 12
  1. #1
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6

    One Report from multiple records

    Hi all

    I'm pretty new on this forum and on Access both, so be polite pls ^^

    Here is my question:
    Let's suppose I have to print a report relative to an order.
    I call the report, that ask me te order number, I give it to him, and the reports correctly display it. "Print", all done.

    Now, I have 10 orders. there is any way to print all those 10 orders in one Report, without calling 10 times the same report?
    I'm thinking, for example, to a report that ask me to insert order numbers untill i press "esc". At that moment it will display just ONE report with ALL the orders i gave to him.
    keep in mind that the number of orders is always different

    I hope to have been clear enough^^

    Thanks

    P.

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    1.
    You said: "I call the report . . ."
    How are calling the report right now? Is it from a Form?

    2.
    Do you know the maximum number of Orders you will want to print on the report at any one time?

  3. #3
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6
    1.
    I'm sorry, I was misleading. I meant that i "run", i "execute" the report, nothing about the report name or something.

    2.
    There is not a maximum number. I suppose it will be very rare if this number is greater than 10.

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    How did you make the Report ask you for the order number?

  5. #5
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6
    I used the "Criteria" slot of the query structure

    Here's an image of the structure, hope it helps, and sorry for the italian language ^^

    with this structure, the report ask me for "n° ordine"


  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    See my screenshot.
    That gave me three records when I ran the query.
    You will still have to enter three criteria.

    Will this work for you?

  7. #7
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6
    the mechanic of what you have suggested works perfectly.
    the "cigar" would be if i will be able to insert infinite "order numbers" untill I press esc. at that moment the report will pop out.
    or, at least, if i will be able to specify the numbers of orders I'm going to insert.

    Btw, thanks a lot so far, this is anyway a great result for me
    Robeen thanks again =)

    P.

  8. #8
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It IS possible . . . but it will not be as easy.

    I think you will have to create a Form - and then provide a box in which to enter your values - and then you will have to have code that will take all the values you enter on the form and put it into an SQL string in the Code and make the report run off that SQL code that has all the records you want to include in the report.

    Something about what you are wanting to do is not making sense to me, though.
    It just seems 'clumsy' to have to enter an 'infinite' number of values off which to run your report.

    Why would you need to type in so many order numbers?

    It would almost be better to include a Y/N field in your 'ordini' Table [EG: Include_In_Report] and put a "Y" in all the rows you want on your report - and then change your query to say something like:
    . . . WHERE [Include_In_Report] = "Y"

    Then - when you run your report - it will display all the Orders that you marked with a "Y".

    No?

  9. #9
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6
    Wait, that's not the right direction.
    When i said "infinite" was just because i just dont know, everytime i'm going to make the report, how many orders i need to display in it, and i thought there was a way to make a report that ask you for a colum data untill you pres, for example, "esc" or another key.

    but just forget about it
    whith your last method i manage to create a report that ask me 4 times the order numer, and thisplay all those i inser in the same report.
    great.
    now it will be even better if i can chose the number of times the report ask me order number. in a nutshell, i want to be able to change the "4" everytime i run the report

  10. #10
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It is possible to reach your ideal solution - but I think it will involve:
    1. Creating a Form,
    2. Coding it to allow you to tell it how many Orders you want to have on the report,
    3. Creating a Loop in VBA to capture that number of OrderNumbers in your code,
    4. Put all the order numbers into a SQL Statement in your Code
    5. Make your report run using the SQL Statement as its source.

    It is a lot easier to do the [Include_In_Report] = "Y" thing - but if you are willing to take the time and effort to create the Form and do teh coding - you will certainly have a more elegant solution for your situation.

  11. #11
    PaoloJTS is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    6
    It is a lot easier to do the [Include_In_Report] = "Y" thing - but if you are willing to take the time and effort to create the Form and do teh coding - you will certainly have a more elegant solution for your situation.
    Am I wrong in the method you are suggesting I have to go to the "ordini" table and mark with a "y" the orders I want them to be in the report?
    it will be a pain.. the report is something I run very often, and I would nees to keep changing the "yes" mark.

    My need boundry is all about the report himself, i just want to work with it

    I hope that's clear enought.

    anyway, thanks a gain Robeen for waisting so much time on me ^^

    P.

  12. #12
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It is possible to remove the 'Y' [Yes] value in the table with a simple 'Update' query every time you need to run your report.
    If you run an Update query like that - all the 'Y' in the Table can be changed to 'N' in a second.
    Then, you can go and put a 'Y' in all the new Orders you want on your report.
    Putting a 'Y' for each Order you want on your report will be a LOT quicker than typing in an Order Number -no?

    BUT . . .

    I don't know if you can do what you are trying to do using the report only.
    I have used Access since 1995 and I have never got THAT fancy with a report.

    I DO know that it can be done using a Form and VBA Code.
    But it is very complicated compared to my suggestion.

    If you want to try doing it using a Form and VBA - let me know, and I will try & help you to find the best way to do it.

    If you want - you can also start a new Thread - so that other experts are more likely to look at your post and try & help!!


    All the best!

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

Similar Threads

  1. Displaying multiple records in a report.
    By CammRobb in forum Queries
    Replies: 10
    Last Post: 07-23-2012, 06:44 PM
  2. Replies: 1
    Last Post: 01-17-2012, 02:54 PM
  3. Lookup Columns Multiple Records in report
    By schultzy in forum Reports
    Replies: 1
    Last Post: 01-02-2010, 12:21 AM
  4. Report to display multiple records by date.
    By af01waco in forum Reports
    Replies: 1
    Last Post: 03-21-2009, 02:12 PM
  5. How do I choose multiple records for a report
    By admaldo in forum Reports
    Replies: 2
    Last Post: 03-03-2006, 06:02 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