473,386 Members | 1,673 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,386 software developers and data experts.

Apply filter on Chart

25
Hi,

i create a chart in ms access based on my query, then i want my chart when is it open is only show value based on my criteria.

i'll try to used it in the properties apply filter using the expression, it didn't work. the chart still viewing all data.
and i used the event "on open" and used "applyfilter" command
then it shown an error.

"that the report isn't bound with the query"

yes, i check it on the properties there are no query that bound to the chart.
so, how can i apply filter for my chart?

thank you.
May 1 '09 #1
10 15076
NeoPa
32,556 Expert Mod 16PB
Hi.

That's not very clear I'm afraid. Perhaps it might help if you posted the code you use to create your chart. Is the chart an object on a report?
May 1 '09 #2
dbdb
25
my chart is on the report.
i build it using chart wizrd in the report.

there are no code.
May 1 '09 #3
NeoPa
32,556 Expert Mod 16PB
You don't start your report with any code? You're sure?

How about the design of the report then? There must be a Record Source.

What's the chart built on data-wise?

I can't work with absolutely no information. A crumb or two is a bare minimum.
May 1 '09 #4
dbdb
25
mm so do i confused when i found no record source on it.
here is the story.

first, i run the report wizard then i choosed to build a chart based on a query.
then the wizard done, and my chart shown on the monitor.

then i want to view the report only the data that i want, but i don't want to use any criteria expression on my query, i want to apply filter on my report chart.
May 1 '09 #5
NeoPa
32,556 Expert Mod 16PB
@dbdb
What is the query the chart is built upon then? I need to see the SQL of it (rather than the name).
@dbdb
You may need to provide the SQL for the report too.

You should also explain how you, as a user of the database, cause the report to run. Do you run it directly from the Database window?
May 1 '09 #6
ADezii
8,834 Expert 8TB
I agree with NeoPa in that you are giving us very little to work with, but first let's straighten out a few points:
  1. I'm making the assumption that the Report does not have a Record Source.
  2. The Chart, actually the Object Frame containing the Chart, does have a Row Source which will populate it.
  3. You can Open the Report in Design View (Hidden), modify the Row Source of the Object Frame containing the Chart, then re-open it, as in:
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.OpenReport "Report1", acViewDesign, , , acHidden
    2. Reports!Report1![OLEUnbound0].RowSource = "TRANSFORM Sum(tblChart.Quantity) AS SumOfQuantity " & _
    3.                                           "SELECT tblChart.Fruit FROM tblChart WHERE " & _
    4.                                           "tblChart.Month='April'GROUP BY tblChart.Fruit PIVOT tblChart.Month;"
    5. DoCmd.OpenReport "Report1", acViewPreview
  4. Any questions, feel free to ask.
May 1 '09 #7
dbdb
25
mmm finnaly....
sorry guys, sometimes we never realize a small miss perception we get.
yes i found the recordsource.

yesterday i always getting confused to find where is the record source in the report properties.
but then today, i realize that the recourdsource is place in the chart properties.

OMG...
sorry for this litlle mistake.
then i can view my chart based on the data that i want.

thank you for your help....

nice to joining in this group.
May 4 '09 #8
NeoPa
32,556 Expert Mod 16PB
It's nice to have you.

I should add one thing that may prove helpful.

Normally, Access objects have a property, separate from the RecordSource property, that enables you to specify some form of filtering.

This allows you to separate the filtering from the basic fundamentals of the data. This is often helpful and simplifies matters. Especially when working in code.

To keep things simple, I suggest you look for, and work with, this property instead of changing the Record Source all the time.

I'm afraid I don't know what the details are for Chart objects, but a quick look through the properties should do it for you.

There is also a way of passing this as a parameter when opening objects in code for forms and reports. See if there is anything available for charts.
May 5 '09 #9
ADezii
8,834 Expert 8TB
@NeoPa
Hello NeoPa, a Chart in Access is an Embedded/Linked OLE Object with the OLE Server being Microsoft Graph. This being said, I do not think that you can 'Filter' it in the traditional sense of the word, but I could be wrong. What you can do is specify Criteria in the underlying SQL, via the Query Grid, by dropping the Field into the Grid, set the Total Row = Where, then specifying your criteria.
May 5 '09 #10
NeoPa
32,556 Expert Mod 16PB
Thanks ADezii. I'm a little hazy on this as I've never played with it myself.

As for updating the underlying SQL, I would see this as amending the Record Source directly. A good plan if there is no option for specifying a filter on the fly, but it does have drawbacks when compared with that option.
  1. It counts as updating the object. Immediately putting the database into exclusive mode, or failing to update if that's not possible.
  2. It leaves the object different from how it was found, and therefore not usable in a multi-user environment. Attempts to replace the original will not really fix this problem in a multi-user environment.
At the end of the day though, it's better than not having access to it at all.
May 5 '09 #11

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

Similar topics

0
by: MaryD | last post by:
Is there any way to use the enter key - or a function key - as the Apply Filter when a form is opened in FilterByForm mode? I can see the value of function keys and the enter key when the form is...
4
by: Iyhamid | last post by:
Hi I am looking for codes to filter and apply filter to my data base using access
3
by: mattscho | last post by:
Hi All, Trying to create a set of 3 buttons in a form that have the same effect as the "Filter by Form", "Apply Filter" and "Remove Filter" Buttons on the access toolbar. Help would be muchly...
1
by: mattscho | last post by:
Re: Filter By From, Apply Filter, Remove Filter Buttons in a Form. -------------------------------------------------------------------------------- Hi All, Trying to create a set of 3 buttons in...
2
by: Nhoung Ar | last post by:
Can anybody out there help me please on apply filter in MS Access. I have a form that create from the query, which contain field chidid (text field), in the form footer, I add the button to open...
3
by: Supermansteel | last post by:
I am trying to run a Apply filter for everytime someone opens Form_CC it will only show the Test (Test_ID) they are working on. This seems to be the closest I have gotten to filtering it correctly,...
1
by: eHaak | last post by:
A couple years ago, I built a database in MS Access 2003. I built the form using macros in some of the command buttons, and now I’m trying to eliminate the macros and just use visual basic code. ...
3
by: dbdb | last post by:
hi guys need your suggestion how can i apply filter for my date variable data type i have a form name transaction and i have a text box on it named : start and finish i need to apply...
7
AccessIdiot
by: AccessIdiot | last post by:
This seems like it should be really easy and I think I'm just missing something really dumb. I have a form that filters a report. At the top of the report I have a bunch of unbound text boxes that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.