Results 1 to 7 of 7
  1. #1
    bucrepus is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    5

    Report Charts changing rowsource

    I have created a chart on a report that is attached to a simple access table with 4 columns. It displays fine. However, I need to change the charts .rowsource property to point to a new table. The new table will have the exact same structure as the old table (essentially a copy of the original table), just a new name and data. I have seen numerous posts about people changing the rowsource property at runtime in the reports VBA events, which I have done sucessfully but I still have an issue.



    My issue is if I change the rowsource, even in the designer without messing with VBA code, the formatting I made to the original chart defaults. The formatiing tab where I set my checkboxes for the various settings such as the legend and axis default to unchecked; I have to reformat the report every time I change the rowsource, even if it exactly matches the same table data structure. I have seen numerous posts about changing the rowsource on the fly but I can't see how that would work since it appears to default all the format settings of the chart. Is there a way to stop this from happening?

    Thanks for your time..

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why do you have multiple tables with same structure? Have one table with another field for a category value that equates to table name. Then apply filter criteria in chart RowSource.
    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
    bucrepus is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    5
    The table will be a temporary table with same structure, different data. Multiple users use the same report at possibly the same time. The FORM creates a TEMP table with a random name with the data that a particular user may want to see and calls the report. I have the TEMP table setup working fine for a separate regular lined report, just the chart is broken. I don't quite get your suggestion of using another table, but am interested if you can further explain..
    Thanks again

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Well, so all your data is located in one table and you are using a temp table to hold selected records just for a process. That wasn't explained in original post. It sounded like you were storing data in separate tables, like a new table for every year or something.

    Why is a temp table needed? How are records selected for this process? If simply applying filter criteria then I don't see why records need to go to a temp table. Chart RowSource can have filter criteria.

    Is this a split database with each user running their own copy of frontend?
    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.

  5. #5
    bucrepus is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    5
    Sorry for not including what you mentioned. I have a single DB used (opened) by several employees from DB file on a server. There is a single blank report with 2 subreports in it; a lined report and a chart report. The report table has four fields, Buyer, Amt1, Amt2, Amt3. The user selects certain data he wants to see, clicks the form button, and the VBA code generates this 4 column temp table (from a larger table), copies the temp table name into a global variable, and the subreports use the global variable (temp table name) as their data source. Works fine on the lined subreport. The data may be diff in each temp table that is displayed in the report. I may be going around the world to do something simple. I was worried about multiple users opening the same report at the same time agaist the same table; maybe some weirdness datawise with the underlying data changing close to the same time, hence I was trying to isolate that by using temptables with their own data table in their process space. I guess you are suggesting loading all the data into one table and using filters passed to the chart report based of the each user displaying the report? I had a heck of a time trying to change the recordsource of the lined report. I haven't tried changing the filter of the chart during runtime; I didn't know if that could be done.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    First, multiple simultaneous user db should be split and each user run their own copy of frontend.

    I have charts on reports that have filter criteria in RowSource. The filter references ID field of data report is bound to like: SELECT X, Y FROM tableORquery WHERE ID=[ID];
    Specifically: SELECT Size, Pass FROM GraphFMD WHERE LabNum=[tbxLabNum] ORDER BY Size;

    Alternatively, could reference a control on form for filter parameter.

    Filter criteria can also be applied to report. That's what WHERE ARGUMENT of DoCmd.OpenReport is for.
    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.

  7. #7
    bucrepus is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2015
    Posts
    5
    Gotcha. I will try this .. Thanks again for your time..

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

Similar Threads

  1. Replies: 2
    Last Post: 05-17-2015, 04:05 PM
  2. Report Charts won't update
    By tomnsd in forum Reports
    Replies: 3
    Last Post: 04-03-2013, 12:07 PM
  3. Grouped Report with Charts
    By FL_Boy in forum Reports
    Replies: 2
    Last Post: 12-21-2011, 09:27 PM
  4. Multiple linked charts in a report
    By gonzo79 in forum Reports
    Replies: 0
    Last Post: 11-09-2010, 05:24 AM
  5. Create Multiple Charts for Report
    By Catch Wrestler in forum Programming
    Replies: 0
    Last Post: 06-21-2010, 10:50 PM

Tags for this Thread

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