Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get a graph with correct data 1

Status
Not open for further replies.

CTOROCK

Programmer
May 14, 2002
289
US
I am having real trouble getting a graph I want. I have a report that has a daily average number of cartons unloaded for a specific employee. My query has a date range parameter, and I have a combo box in a form that tells the report who to do it for. Eg. If I select "Joe Blow" from the combo box, it will call the report with WHERE [Employee] = "Joe Blow", the report then calls for a date range.
I want a graph to represent only the data for that employee and date range each time. I can't do it. It asks me a million time for the data parameter. I tyied to do it with a form, but I still can get the data I want. Can anyone help? thanks!

"The greatest risk, is not taking one."
 
if you hardcode in a date and other criteria (instead of referencing a form, etc) does the chart show what you want?

when you say "It asks me a million time for the data parameter" try this: in the query that your chart is based on, right-click up top and choose PARAMETERS. put in for example [forms]![FormName]![DateFrom] and type Date. do that for all the parameters you have. see if that works.
 
Thanks for your time Ginger,

That sounds great, but I can't get it to work. In the Parameters in the menu of the query I put:
PARAMETER DATA TYPE
[forms]![Frm_EmployeeGraph]![TxtDate1] Date/Time

but I get an invalid bracket name. Do you know why? How does it know which field to use this prameter in? What if I have a date range?

Thanks in advance


"The greatest risk, is not taking one."
 
it knows because this is exactly what you have down below, as criteria in the query grid.
is that how you have it?
what i'm saying is that ANY criteria you have in the query grid down below, put those things in the PARAMETERS area with their data types.
so try that and let me know how it goes.
also--again--if you hard code in some dates (i.e. Between 1/1/03 and 12/31/03) does it work?
 
Thanks a lot! I got it to work perfectly! However, my graph data, when I choose to view the data value for each point, gives me a milliong decimals. I try to format it with each point on the datasheet, but it doesn't work. I would like to see 0 decimals, and I can't tell the query to do so, right? There's got to be a way to do it in the graph, right? Can you help me with this? thanks again.

"The greatest risk, is not taking one."
 
you can set the format in the graph, but it won't work. MS doesnt spend a lot of energy on their graphing feature in Access. Instead, i've had to do some wierd stuff over the years. within your query, try this:

rounding:
int([Field]+.5)

if you ever want to round to one dec place:
(Int(([Field]+0.05)*10))/10

if you ever want to round to two places:
(Int(([Field]+0.005)*100))/100

and so on.
in your chart, you can also make a data table (shows data in a grid below the chart). didnt know if you knew this. double-click (design) on the chart, go Chart Options and choose Data Table.

by the way, if the above doesnt work either, put cstr(xx) where xx is the string above. believe me, the chart gig is a little bit of a nightmare some times :))
 
Eureka! Thank you for sharing your method. Unforunately, I've always considered graphs as my biggest weakness in Access, and I've always been ashamed because I thought they were really simple, but still I found my self perplexed at times deciphering it's logic. But I can't thank you enough for sharing your know-how to get results. Thanks, for I now truly feel a lot better in graphs.

"The greatest risk, is not taking one."
 
want some other tips? the biggest i have to offer is this, if you don't do it already: in order to get rid of the North/South/East/West template-kinda thing, do this:
in your report design, right-click on the chart and view PROPERTIES. go look at the table or query that the chart is based on. run it; copy the resulting datasheet. go back to the design of the report; double-click on the chart. now you are in Chart Design. view DATASHEET. paste (control+v) into the datasheet, overwriting the standard 'template' crap they put in there. now look at your chart design. this helps a lot with formatting (make it good colors, bold lines, etc) so you can see what you are really dealing with. maybe if you have a simple column chart it doesn't matter much, but it will some day!!

enjoy!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top