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.
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.
- 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.
- 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.
- 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).
- Ignore the Field Names used for testing, they were only used for testing and are meaningless in the current context.
-
Private Sub Form_Current()
-
Me.Parent![<Your Chart Name Here>].RowSource = "TRANSFORM Sum([Ver_Number]) AS [SumOfVer_Number] SELECT " & _
-
"[Delivered_Date] FROM [tblTest] WHERE " & _
-
"[Delivered_Date]=#" & Me![Delivered_Date] & "# GROUP BY [Delivered_Date] PIVOT [DashNum];"
-
End Sub
-
- 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.
- If I can further assist, please feel free to ask
- 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.
- I think I better quite while I'm ahead at this point. (LOL).
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 Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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:
|
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:
|
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...
|
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...
| |
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}"
|
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...
|
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
|
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...
|
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,...
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |