Setting RowSource of a Graph

JCollins

Registered User.
Local time
Today, 10:11
Joined
Dec 3, 2001
Messages
13
I'm hoping that better minds than mine will figure this out:

In my Report's On Open Event, I have the following:
'Set the RowSources for the Graph #1
Select Case [Forms]![frminput]![optionGrouping]
Case 1
strGraphFrom = "qry_Detail_Raw "
Case 2
strGraphFrom = "qry_Detail_District_Raw "
Case 3
strGraphFrom = "qry_Detail_DepOPS_Raw "
Case 4
strGraphFrom = "qry_Detail_CGES_Raw "
Case Else
End Select
strGraphSQL1 = "SELECT DClass_Name, Sum(Sales) AS SumOfSales, Month_Name, UNIT, Month_Number, Year " & _
"From " & strGraphFrom & _
"GROUP BY DClass_Name, Month_Name, UNIT, Month_Number, Year " & _
"HAVING Month_Number=[forms]![frmInput]![month] AND Year=[forms]![frmInput]![year];"

Me.Graph56.RowSource = strGraphSQL1
MsgBox strGraphSQL1 'used for testing to see if it works...this does
MsgBox Me.Graph56.RowSource 'used for testing to see if it works...this does not


The strGraphSQL1 is correct (when I actually copy the SQL statement into the Rowsource, it works, but it will not work dynamically...For some reason, it will not assign it to the "me.graph56.Rowsource"...

Where did I go wrong?

[This message has been edited by JCollins (edited 01-30-2002).]
 

Users who are viewing this thread

Back
Top Bottom