473,666 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

26 New Member
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 3477
ADezii
8,834 Recognized Expert Expert
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 New Member
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
2191
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 probably should put it on a report and call that report from the form but for various reasons I need the chart on this form. In a table bound to this form I have a Yes/No field and then from a checkbox the user should get to choose if the form is...
4
2273
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 companies on a form. 3 of the companies have common employees. I have a table that looks like this:
5
2633
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 allowed, one-to-one. If I update field(s) on a single subform it works fine but when I update fields on multiple subforms ie without closing the form between updates, I get the following error:
1
2216
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 varchars and removed nulls. I noticed some Foreign keys were NULL? I copied data to new table and deleted the null FK. I then changed POID to not null. POID is PK in tblPO and FK in items. I have verified the SUBFORM is using POID for parent...
1
2713
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 for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the ftp site and gets the file name for any update files on the site. I already have code to do this...
17
2582
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 Len(Trim$(Me!.Value & "")) = 0 Then 'This checks for blank or space-filled date field - it will only transfer data if it has not already been entered. Me! = !!.!.! SendKeys "{F2}" SendKeys "{TAB}"
4
8830
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 which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
6
3674
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
1844
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 subform, it saves those previous subform records fine, but when I make changes to the subform records and then change the mainform criteria, it doesn't save those subform records. I can use an event to prompt for saving the records on the...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.