Results 1 to 6 of 6
  1. #1
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182

    Graph based on query in Access form

    Hello.




    I am trying to create a form (called frmCountry_Incidents) where I enter parameters into "txtStartDate", "txtEndDate", and "txtCountry" which is linked to a query called qryCountry_Incidents. So far, I am completed this and it works well.


    Next, I want to include a bar graph on the same form (frmCountry_Incidents). I want to click a command button on the form and then have a bar graph (which is pulling data from qryCountry_Incidents) so display the value based on the parameters (txtStartDate,txtEndDate,txtCountry) that I enter on my form.


    I am having issues on doing this. Is someone able to walk me through this? I have not had any experience with graphs in access.


    Thanks

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Have you tried Google or Youtube? These are often excellent sources of info, or at least will help focus your search for details and information.

    Try this as your search criteria youtube ms access graphs charts

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The form should have these controls for the user to enter,
    txtStartDate, txtEndDate,etc...

    the query will read these,
    select * from table where MyDate between forms!myForm!txtStartDate and forms!myForm!txtEndDate

    then put the graph on a form using this query,
    the graph may need refreshed ,use the REFRESH ALL button on the toolbar.

  4. #4
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182
    I have tried that, but for some reason it does not work.

    If I enter an exact value into my query (as oppossed to something like [forms]![Country_Incidents]![txtCountry]), then I graph returns the way I want. But if "[forms]![Country_Incidents]![txtCountry]" is listed in my query fields, then the graph only shows me default "East/West/North and 1qtr/2qtr/3qtr/4qtr" data points...

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  6. #6
    zashaikh is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    182
    Thanks,

    Ive looked at both videos previously, but neither have helped. Basically, this is how my bar graph keeps turning out:

    Click image for larger version. 

Name:	2.png 
Views:	20 
Size:	6.4 KB 
ID:	27770

    The only reason I can think why this is happening is because Access is refusing to take into account the criteria I place in my query (below)

    Click image for larger version. 

Name:	1.png 
Views:	19 
Size:	9.7 KB 
ID:	27771

    If I replace the criteria with a hard value, for example, {{{mexico}}} instead of {{{[forms]![CountryIncidents]![txtCountry]}}}, then the bar graph would work...

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

Similar Threads

  1. Replies: 3
    Last Post: 07-26-2016, 02:12 PM
  2. Replies: 24
    Last Post: 07-28-2015, 10:50 AM
  3. Replies: 7
    Last Post: 07-11-2013, 10:45 AM
  4. Replies: 6
    Last Post: 02-29-2012, 03:13 AM
  5. Replies: 3
    Last Post: 01-10-2011, 10:31 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