Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Oct 2007
    Location
    Beverly, USA
    Posts
    104
    Thanks
    0
    Thanked 1 Time in 1 Post

    Arrow

    I have an Access conundrum. A colleague of mine has written 4 (very useful) reports. I am putting together a form that will allow users to get these reports by simply pressing a button.

    I would like to set this up so that if a user wants all 4 reports they don't have to enter the record id 4 times--3 of the other queries on which the reports are based can just grab the value that the user entered in the first time.

    So far I have not been successful. I tried using the expression builder in one of the queries to point to the record ID field in the first query. That didn't work. I added the first query in to the second query and tried to pull the value in that way. That didn't work either (although the ways it broke the query were most interesting!)

    Any suggestions?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    [quote name='chris.revere' post='789825' date='19-Aug-2009 14:28']I have an Access conundrum. A colleague of mine has written 4 (very useful) reports. I am putting together a form that will allow users to get these reports by simply pressing a button.

    I would like to set this up so that if a user wants all 4 reports they don't have to enter the record id 4 times--3 of the other queries on which the reports are based can just grab the value that the user entered in the first time.

    So far I have not been successful. I tried using the expression builder in one of the queries to point to the record ID field in the first query. That didn't work. I added the first query in to the second query and tried to pull the value in that way. That didn't work either (although the ways it broke the query were most interesting!)

    Any suggestions?[/quote]
    The simplest solution is to add a button to the form where the records are being viewed, and let the wizard build the VBA to print that one report. Then open the event procedure for the button and modify it to print the other three reports as well. You can simply add two lines for each report, one to set the value of the variable the wizard created to the report you want to print, and then a second line that duplicates the OpenReport command that the wizard created. If any of the reports are likely to not have data for some reason, you may want to add error handling for that case.
    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
  •