Results 1 to 5 of 5
  1. #1
    Russellh is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    68

    How do I copy a Report and point it to its Copied Query

    So I have this killer report that took me hours to set up. I run it daily and it is great.
    I now need to filter it slightly for 1 specific user. So what I did was I copied the query and renamed it. I added the filter I needed. But I don't want to have to re-create the report. Even though I know what I need it will take quite a bit of time to recreate it.



    Is there a better way? Can I copy the report (using the same query) but add the filter on the report side?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Manage the filter with info from a form. Many ways to accomplish. Do you have a login procedure? Do you have a table of Users? Even if you don't have a login procedure, can have a table of users with info specific for each user. The user can be identified by their network login then look up the user on the table to determine specific requirement. Use VBA code to build filter criteria.

    If {condition based on UserID or some other parameter from users table} Then
    strFilter = "this criteria"
    Else
    strFilter = "this other criteria"
    End If
    DoCmd.OpenReport "report name", , , strFilter
    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
    Russellh is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    68
    It isn't a real necessity to have user controls and such. I'm going to copy the query and give it to the user to run at his will.
    I have a query that pulls all service orders that didn't auto process.
    I built a report off this query that makes it all pretty for users to look at and process the SO's manually.
    I copied that query and in design view I added "*shastap*" under the FSR Criteria so that the same query would now just pull SO's for that user.
    I need to now copy the report so that I don't have to rebuild the thing from scratch. But simply copying the Report points to the original query which I can't modify. If I do modify it has to be modified everytime it is ran for all open orders and then again to show his open orders.
    I was hoping there was a process to accomplish this without rebuilding a report off of the new copied query.

  4. #4
    Russellh is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    68
    I was able to just change the Record Source of the new report to the name of the new query. Since everything was identical (except I added criteria to one of the columns) it worked like a charm!!

    I still think there is a better "best practice" for doing this as this method could be a maintenance nightmare if you did it alot.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I already described alternative that did not require copying the query or the report.
    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.

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

Similar Threads

  1. Replies: 14
    Last Post: 03-25-2015, 12:49 PM
  2. Copied Report Malfunctioning
    By DragonTech in forum Reports
    Replies: 2
    Last Post: 06-23-2014, 10:12 AM
  3. Help with RunSQL string copied from an update query
    By PlamenGo in forum Programming
    Replies: 14
    Last Post: 04-23-2014, 01:32 PM
  4. Replies: 1
    Last Post: 09-21-2012, 03:31 PM
  5. Copied report columns, gridlines uneditable
    By hardwood in forum Reports
    Replies: 1
    Last Post: 06-14-2011, 06:22 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