NJudson
02-25-2002, 05:48 AM
I don't know if there is a way to do this but I have a form with a listbox which displays results of an SQL statement when I click my run query button. I then have my listbox with a double-click procedure attached to it which runs another SQL statement and displays the results of that in a different form. Here is my Double-Click statement:
Private Sub ListTotals_DblClick(Cancel As Integer)
Dim SWITCH As String
DoCmd.OpenForm "frmBreakOutDS", acFormDS
SWITCH = cboSwitch.Value
Forms!frmBreakOutDS.RecordSource = "SELECT [Totals].[Cell-ID], [Totals].[FBER Drop Attempts/Call Volume], " & _
"[Totals].[Digital Call-Volume], [Totals].[FBER-Drop-Attempts], " & _
"[Totals].[Switch], [Totals].[Date] " & _
"FROM Totals " & _
"WHERE [Totals].[Cell-ID] = '" & Me.ListTotals & "' " & _
"And [Totals].[Switch] = '" & SWITCH & "' " & _
"ORDER BY [Totals].[FBER Drop Attempts/Call Volume] DESC;"
Me.Refresh
End Sub
My question is these results that are outputed to this other form I want to be used to make a graph of chart(preferably just a line graph). If I use the chart wizard it only has the option to base it on a table or query. How can I make a chart or graph based on the SQL results that are displayed on my form.
1) First of all I have this SQL statements hardcoded because I have the user select a multitude of options on the original form(listbox form). And using standard queries would not be a viable option for what I'm doing.(at least this is the case with my limited knowledge of all this)
2) Is there a better way of running my Double-Click procedure to output the results from the 2nd SQL statement? Perhaps not to a form but something else which I can make into a graph.
3) Or can I somehow open and excel app and make a chart from that?
I'm not sure what the best way to do this is and would greatly appreciate any advice or direction on this. Thanks.
Private Sub ListTotals_DblClick(Cancel As Integer)
Dim SWITCH As String
DoCmd.OpenForm "frmBreakOutDS", acFormDS
SWITCH = cboSwitch.Value
Forms!frmBreakOutDS.RecordSource = "SELECT [Totals].[Cell-ID], [Totals].[FBER Drop Attempts/Call Volume], " & _
"[Totals].[Digital Call-Volume], [Totals].[FBER-Drop-Attempts], " & _
"[Totals].[Switch], [Totals].[Date] " & _
"FROM Totals " & _
"WHERE [Totals].[Cell-ID] = '" & Me.ListTotals & "' " & _
"And [Totals].[Switch] = '" & SWITCH & "' " & _
"ORDER BY [Totals].[FBER Drop Attempts/Call Volume] DESC;"
Me.Refresh
End Sub
My question is these results that are outputed to this other form I want to be used to make a graph of chart(preferably just a line graph). If I use the chart wizard it only has the option to base it on a table or query. How can I make a chart or graph based on the SQL results that are displayed on my form.
1) First of all I have this SQL statements hardcoded because I have the user select a multitude of options on the original form(listbox form). And using standard queries would not be a viable option for what I'm doing.(at least this is the case with my limited knowledge of all this)
2) Is there a better way of running my Double-Click procedure to output the results from the 2nd SQL statement? Perhaps not to a form but something else which I can make into a graph.
3) Or can I somehow open and excel app and make a chart from that?
I'm not sure what the best way to do this is and would greatly appreciate any advice or direction on this. Thanks.