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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help from hughesai

Status
Not open for further replies.

hnwfsu

Programmer
Sep 5, 2002
9
US
hughesai.....you had responded to my question about the pie chart in access reports....

would you be able to send me some code example of what you are talking about???

thanks!
hw



 
I have the code at home - I'm in work now - I'll post later tonite.
 
The example I quoted uses the code below. I have a report "Rpt1". In that there is a charts called "Graph11" and a text box called "Location".

Based on options selected in the calling form, I set strings for the record sources of the report and the chart, and also for the text box. Further, I set up a string for the link between the chart and the report.

The code then opens the report in design view,
sets the record source for the report,
sets the record source for the graph,
sets the chaild and master fields for the link between the report and chart,
sets the control source for the Location text box,
and finally saves the report.

I then open te report as usual for the ser to see it.

The echo false / true bits make these changes invisible to the user, althouhg it does take a little longer for the report to appear to them.

DoCmd.Echo False, ""
DoCmd.OpenReport "Rpt1", acDesign, "", ""
Reports!rpt1.RecordSource = stSQLRpt
Reports!rpt1!Graph11.RowSource = stSQLChart
Reports!rpt1!Graph11.LinkChildFields = stLink
Reports!rpt1!Graph11.LinkMasterFields = stLink
Reports!rpt1!Location.ControlSource = stLocation
DoCmd.Close acReport, "Rpt1", acSaveYes
DoCmd.Echo True, ""

 
hopefully you are checking this today...first of all THANK YOU for posting your code....i have some questions too though:

1. i only need the sql for the chart...i have nothing else on the report...will this still work???
2. can you explain the purpose of location??? and what sort of information will be contained in this property?
 
You're absolutely welcome - that's what this forum is for!

1. Yes
2. Location is probably unimportant to you - it is just a field I need on the report - it is not a property. It may change depending on the users input and is part of my Master / Child link between chart and report. If you only have a chart and the link is not dynamic, you should not need to worry about it. It could be any field!!!! Apologies if this has confused you - my naming conventions for fields are not always what it should be!

 
well i got the pie chart working!!!! :) it's a little messy with all the colors but that is what they asked for...i am guessing i will have to change the chart type...which is fine...

are you up for another challenge??? i haven't used access in quite some time and have been spoiled by the world of sql server so writing some of these queries and reports has been a headache!

anyway....here is my data

ID ACCTNUMBER BALANCE
1 123 1.00
1 124 1.00
1 125 2.00
2 133 3.00
3 143 5.00
3 144 1.00

i need the report to basically line the acct numbers up HORIZONTALLY not vertically so it would look like this

ID ACCTNUMBER BALANCE
1 123 124 125 4.00
2 133 3.00
3 143 144 6.00

i am thinking i will have to do some magic with a temp table...what do you think???

THANK YOU AGAIN FOR YOUR HELP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top