Results 1 to 3 of 3
  1. #1
    Herbolife is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    3

    Opening reports from within a report.

    Hello everyone,

    The question I have is a little hard to explain for me, so please bear with me.

    This report displays all records from a table named "hardware" in an overview. To the right you'll see each record comes with a button named "details"



    Click image for larger version. 

Name:	Rapport Overview.png 
Views:	5 
Size:	19.6 KB 
ID:	11829

    I also have a report for details, which shows a specific record with additional details which it gets from both "Hardware" and another table. This report works with a query which is dependant of the "HardwareID" value. For example, when you enter "2" in the query, it'll grab all the details from that record.

    Click image for larger version. 

Name:	Query.png 
Views:	5 
Size:	24.4 KB 
ID:	11830

    Click image for larger version. 

Name:	Rapport Specifiek.png 
Views:	5 
Size:	22.7 KB 
ID:	11831

    What I want is that if you press the "Details" button on the overview report, it automatically grabs the HardwareID of that value, and uses it to run the query and thus get the corresponding details report.

    If any additional information is required, please let me know.

    Thanks a lot in advance for your time

    Greetings,
    Sebastian

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Reports are not really intended to be interactive. Buttons won't work in Print Preview. If the reports are not to be printed and don't have any fancy grouping and sorting, why not use forms? Forms are intended for screen display.

    However, try the WHERE CONDITION of DoCmd.OpenReport

    DoCmd.OpenReport "reportname", acViewPreview, , "HardwareID=" & Me!HardwareID
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Herbolife is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    3
    Hey June,

    Thanks for your reply. As for the reports, they are supposed to be printable (both of them).

    After goofing around with the code you gave me a little I got it to work exactly as I wanted (only replaced acViewPreview with acViewReport). Did a few tests and it's working perfectly now.

    So thanks a lot, you've been most helpful

    Cheers!

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

Similar Threads

  1. Opening Different Reports on Combobox Selection
    By confusedlilly19 in forum Reports
    Replies: 1
    Last Post: 06-24-2012, 03:46 PM
  2. Replies: 3
    Last Post: 06-05-2012, 01:47 PM
  3. Replies: 1
    Last Post: 01-10-2012, 03:44 AM
  4. Replies: 3
    Last Post: 06-03-2011, 08:58 AM
  5. Opening a report
    By mwabbe in forum Access
    Replies: 3
    Last Post: 09-17-2010, 09:19 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