displaying chart in access

W

wenckdm

I have a form built with a listbox that is multi-selectable and a combobox. I
want to use these to display a chart on the form.
I originally had 2 comboboxes that when data was selected from these the
chart would display the appropriate info.
How do I use the muti-select listbox to display the data for the chart? Can
this be done?
I wrote a small sub function that gets the data from the listbox and I can
display that in a Message box. I also concatenated the query from the
workable combobox/chart pairs. It looks like this:
Dim StrSql As String
strReturn = Chr$(13)

StrSql = StrSql & "TRANSFORM Sum(qryGraph.CountOfrealAct) AS
SumOfCountOfrealAct " & strReturn
StrSql = StrSql & "SELECT qryGraph.REALACT " & strReturn
StrSql = StrSql & "FROM qryGraph " & strReturn
StrSql = StrSql & "GROUP BY qryGraph.REALACT "

Dim flgStatSelectAll As Boolean
Dim strIN As String

For i = 0 To SelectListBox.ListCount - 1
If SelectListBox.Selected(i) Then
If SelectListBox.Column(0, i) = "*" Then
flgStatSelectAll = True
End If
strIN = strIN & "'" & SelectListBox.Column(0, i) & "',"
End If
Next i

StrSql = StrSql & "HAVING (Categories.CategoryName)= " & strIN & ");"
MsgBox StrSql

MsgBox strIN

Can I do anything with this to display the chart?
 
Top