473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

updating a chart on a form when data on a subform changes

I'm sure this is probably really easy but it's hanging me up so I'll go ahead and ask the question.

I have an unbound form that contains a subform containing query results in tabular format.

I want a chart on the main form that updates itself based on the currently selected record in the subform.

So far I've tried using the refresh method placed in the on change() event of the subforms properties box but nothing happens.
Nov 14 '07 #1
2 3452
ADezii
8,834 Expert 8TB
I'm sure this is probably really easy but it's hanging me up so I'll go ahead and ask the question.

I have an unbound form that contains a subform containing query results in tabular format.

I want a chart on the main form that updates itself based on the currently selected record in the subform.

So far I've tried using the refresh method placed in the on change() event of the subforms properties box but nothing happens.
  1. Base the Record Source of the Chart on a Subset of the data that is the Record Source for the Sub-Form. If the Sub-Form's Name is tblTest, create the Chart using several Fields from tblTest.
  2. Copy and Paste the Record Source of the Chart to the Current() Even of the Sub-Form adding a WHERE Clause to regenerate the Chart for a specific Field Value in the Current Record.
  3. In my testing, the Value of the [Delivered_Date] Field in the Sub-Form is used to redraw the Chart for the Current Record in the Sub-Form (Notice the added WHERE Clause).
  4. Ignore the Field Names used for testing, they were only used for testing and are meaningless in the current context.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Current()
    2. Me.Parent![<Your Chart Name Here>].RowSource = "TRANSFORM Sum([Ver_Number]) AS [SumOfVer_Number] SELECT " & _
    3.             "[Delivered_Date] FROM [tblTest] WHERE " & _
    4.             "[Delivered_Date]=#" & Me![Delivered_Date] & "#  GROUP BY [Delivered_Date]  PIVOT [DashNum];"
    5. End Sub
    6.  
  5. I realize that my explanation is very clumsy, and I do apologize for it, but there seems to be no easy way to explain how to accomplish this. All I can tell you is that it has been tested and is fully functional.
  6. If I can further assist, please feel free to ask
  7. Basically, you are changing the Row Source of the Chart in the Current() Event of the Sub-Form based on a specific Field Value in the Current Record.
  8. I think I better quite while I'm ahead at this point. (LOL).
Nov 15 '07 #2
tezza98
38
when you select the the record you need to pass the record values to the chart, you can pass them in different ways depeding on how the chart works, but basically you need to chart values to point to the record values, so you need to pass the record values from the subform, maybe using the onclick or ongotfocus method, pass the values to the chart variables, and then refresh the main form or chart.

check out this site for more detailed info about accessing form and subform properties and controls from a subform or form
http://www.mvps.org/access/forms/frm0031.htm
Nov 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim | last post by:
I have this chart on a form. I'm trying to get this chart to render only if the user chooses to do so. This because of that the chart is quite complex and takes some time to render. I know that I...
4
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5...
5
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates...
1
by: abefuzzleduser2 | last post by:
we use Access 2000 with linked tables in SQL Server 2000. I have a form and a datasheet subform based on a table. This was not related to the parent table before and I was changing nvarchars to...
1
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy...
17
by: lokidog | last post by:
I am trying to automatically transfer data from one textbox to another between subforms within a 'main' form. I put this code into the Gotfocus eventprocedure: Private Sub Date_GotFocus() If...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
0
by: jwbird | last post by:
I have a main form with multiple Subforms that are all displaying Datasheet information related to the Main form record. When I make changes/adds to the records(s) in the subform and tab to another...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.