Results 1 to 4 of 4

Thread: REPRESENT graph/PIE in form based result of query

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    REPRESENT graph/PIE in form based result of query

    Query2 extract a value from table Access and ADO.
    First column is month second num of transaction.

    How to represent a graph/pie in form where X is the month and Y the number of transaction by month

    how to?
    Attached Images Attached Images  

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: REPRESENT graph/PIE in form based result of query

    One way is to use the MSChart Component.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Re: REPRESENT graph/PIE in form based result of query

    Quote Originally Posted by SamOscarBrown View Post
    One way is to use the MSChart Component.
    tks, bro...but i'm sorry
    i need in a userform of vba for Excel project

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: REPRESENT graph/PIE in form based result of query

    Then you are in the wrong forum...should be office development.

    MSChart may work in VBA, not sure....anyway,,,,here is an example in VB6.

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        MSChart1.chartType = VtChChartType2dPie
        MSChart1.ColumnCount = 12
        MSChart1.RowCount = 1
        List1.AddItem ("1-5751")
        List1.AddItem ("2-7464")
        List1.AddItem ("3-7995")
        List1.AddItem ("4-7805")
        List1.AddItem ("5-7051")
        List1.AddItem ("6-8431")
        List1.AddItem ("7-8946")
        List1.AddItem ("8-3068")
        List1.AddItem ("9-5654")
        List1.AddItem ("10-3456")
        List1.AddItem ("11-6389")
        List1.AddItem ("12-5498")
        Dim chartArray(11) As Integer
        Dim x As Integer
        Dim monTrans() As String
        For x = 0 To List1.ListCount - 1
            List1.ListIndex = x
            monTrans() = Split(List1.Text, "-")
            chartArray(x) = monTrans(1)
        Next x
        MSChart1.ChartData = chartArray
    End Sub
    I'll ask a moderator to move this Thread to the proper forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width