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

Create chart on access form using data from SQL

Status
Not open for further replies.

ktb916

Programmer
Jan 22, 2004
76
US
I want to create a chart on an access form from data I'm pulling from a table using an SQL statement and I'm totally lost. The form allows the user to select year and quarter combinations to view performance data. What options do I have for creating the chart? Is there an object I can assign this data to?

Any help always appreciated.

KTB916 - as always humbly begging for help!
 
Create an sql, after a chart from it, and modify the rowsource property of the chart (form's code).

fe:

Private Sub cmbHo_AfterUpdate()
refreshForm
End Sub

Private Sub refreshForm()
dim d as string
d = "TRANSFORM Sum(Round([avgEllErt],10)) AS [SumOfavgEllErt] " & _
" SELECT [TeruletSzam] FROM " & _
" (SELECT * FROM (SELECT *, ""VezEll"" as boolEllenorzoVizsg from qry_VezetoiEllenorzes_BevittEsHianyzoEllenorzes WHERE ((iHo = " & Me.cmbHo & ") AND (strMuszakNev = """ & Me.txtMusz & """))) " & _
" UNION (SELECT *, ""DolgEll"" as boolEllenorzoVizsg from qry_DolgozoiEllenorzesTeruletenkentHavonta WHERE ((iHo = " & Me.cmbHo & ") AND (strMuszakNev = """ & Me.txtMusz & """))) ) " & _
" GROUP BY [TeruletSzam] PIVOT [boolEllenorzoVizsg];"

Me.ChartVezetoiEsDolgozoiEllHavontaTeruletenkent.RowSource = d
End Sub

ide
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top