Results 1 to 4 of 4
  1. #1
    hemantsogani is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    18

    Generate Charts for all groups (values in a column) in one go in one file

    I have created a mechanism to draw the charts for one "Bird" at a time. This is done by entering the name of the bird (American Robin, American Crow or American Goldfinch) in the Form Bird and then clicking the button.



    I want to be able to draw the charts for all the birds (the actual database has many more birds) in one go and in one file. How can I do it?
    Attached Files Attached Files

  2. #2
    hemantsogani is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    18
    Does the solution suggested in "Multiple column charts for the same query" require the insertion of multiple charts in the report i.e. one per Bird?
    Is there a way to loop through all the unique values of Bird using just one chart?

  3. #3
    hemantsogani is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    18
    I created a module to loop through the distinct Birds in BirdsHome. The Code is:
    Option Compare Database


    Public Sub PrintCharts()
    Dim daDb As DAO.Database
    Dim daRs As DAO.Recordset
    Dim sSql As String
    Dim MyControl As Control
    Dim i As Integer
    Set daDb = CurrentDb
    sSql = "SELECT DISTINCT BirdsHome.Bird FROM BirdsHome;"
    Set daRs = daDb.OpenRecordset(sSql, dbOpenSnapshot)
    DoCmd.OpenForm ("Bird")
    For i = 0 To daRs.RecordCount - 2
    Set MyControl = Forms!Bird.Bird
    MyControl.Value = daRs!Bird
    DoCmd.OpenForm ("WeeklyNumbers")
    DoCmd.PrintOut (acPrintAll)
    DoCmd.Close acForm, "WeeklyNumbers"
    daRs.MoveNext
    Next
    daRs.Close
    Set daRs = Nothing
    Set daDb = Nothing


    End Sub

    This prints the charts but it is one chart per file. Is there a way to get all the charts in one file?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why don't you build a report?

    What do you mean by 'chart'? There is no chart/graph in database.

    Why not use a combobox for selecting bird?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. ACCESS AUTO generate charts
    By zubair136 in forum Access
    Replies: 3
    Last Post: 07-27-2019, 01:41 PM
  2. Replies: 3
    Last Post: 05-09-2018, 11:11 AM
  3. Replies: 34
    Last Post: 08-09-2017, 09:57 AM
  4. Replies: 14
    Last Post: 07-13-2015, 12:47 PM
  5. Multiple column charts for the same query
    By SltPhx in forum Queries
    Replies: 2
    Last Post: 08-29-2012, 12:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums