By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Using Microsoft graphs to Display In Subform

ChaseCox
100+
P: 294
I am using Access 97 to build my Database. I would like when my query is run, to populate a graph from the results of the query. Currently I am using a form to populate the query, and the query is then displaying the resulting records into a datasheet view on a subform. It is the resulting records I would like displayed on the graph. The fields I want on the graph are Prod_Code and Claim_Date. Thanks for the help.
Jan 16 '07 #1
Share this Question
Share on Google+
10 Replies


NeoPa
Expert Mod 15k+
P: 31,263
I'm not even sure Access does graphing (I'll probably be proved wrong here).
Excel, of course, handles them very well. Might that be a viable solution?
Jan 17 '07 #2

nico5038
Expert 2.5K+
P: 3,072
Did you try to insert a Graph object on a form ?
Just use your query as the source.

Nic;o)
Jan 17 '07 #3

ChaseCox
100+
P: 294
Yes, I am using the insert graph function, and referencing my query. The problem is that the when the form is opened, the query is run by the graph and produces useless data. I need it to wait until I run the query from the form.
Jan 18 '07 #4

nico5038
Expert 2.5K+
P: 3,072
Hmm, for this type of timing problems I use to switch from a query to a temp table as a source for the graph. Is changing your query into a maketable query an option ?

Nic;o)
Jan 18 '07 #5

NeoPa
Expert Mod 15k+
P: 31,263
Yes, I am using the insert graph function, and referencing my query. The problem is that the when the form is opened, the query is run by the graph and produces useless data. I need it to wait until I run the query from the form.
I've never used this myself, but if it's like forms and reports then it will have a RecordSource or DataSource property somewhere. Is it possible to leave this empty in the design of the graph and populate it using VBA code as-and-when you're ready for it to work?
Jan 18 '07 #6

ChaseCox
100+
P: 294
No, I can not make it a make table. I will try to tamper with the record source.
Jan 18 '07 #7

ChaseCox
100+
P: 294
This is what the chart lists as the Row Source.

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Count([PROD_CODE]) AS [CountOfPROD_CODE]
  2. SELECT (Format([CLAIM DATE],"MMM \'YY"))
  3. FROM [Labor Query]
  4. GROUP BY (Year([CLAIM DATE])*12 + Month([CLAIM DATE])-1),(Format([CLAIM DATE],"MMM \'YY"))
  5. PIVOT [PROD_CODE];
Any ideas how I can alter this to do what I am looking for, which is make the graph once I run the query. I am using the Insert chart function.
Jan 18 '07 #8

NeoPa
Expert Mod 15k+
P: 31,263
I'm not sure what you want done differently.
Basically, you put something very like the code that's there already. Changes would be made depending on what you require to be different from the original.
Jan 18 '07 #9

ChaseCox
100+
P: 294
I'm not sure what you want done differently.
Basically, you put something very like the code that's there already. Changes would be made depending on what you require to be different from the original.
It is running without me telling it to, basically. I need to do something similair to chaning its record source on the fly. Any ideas?
Jan 18 '07 #10

NeoPa
Expert Mod 15k+
P: 31,263
I guess I wasn't clear enough.
  1. Save the string that is there already.
  2. Change the design to remove the RecordSource (Change it to empty).
  3. Put in the event procedure (OnClick of Command Button or whatever) an assignment of the string you saved earlier into the RecordSource of the object.
  4. Requery the object (still in the Event Procedure).
Does that explain it?
Jan 18 '07 #11

Post your reply

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