Results 1 to 4 of 4
  1. #1
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186

    Update a Graph based on two independient field with dates

    Hi everyone,

    I have a question regarding a graph I added into a form

    I want to update the graph based on a query named "tasks" and into my form I added two dates named "startdatetxt" and "enddatetxt" (both independient fields) as well a button named filtercmd

    the query does not include the dates for the task, if I do this the graph shows a big division of the pie and just want to see how many are pending and closed from a period of dates

    '*************************


    Private Sub Filtercmd_Click()

    Me.Requery
    Me.Filter = ""
    Me.FilterOn = False


    If Me.StartDatetxt <> "" And Me.EndDatetxt <> "" Then


    Me.Requery

    'I don't know how to define this line below....
    'Pie_Graph
    'I was using this to calculate for a form based on a query but in this particular case I am sure how to do this...


    'Me.Pie_Graph.Filter = "[Fecha_Accion] >= #" & Format(StartDatetxt, "yyyy-mm-dd") & "# And [Fecha_Accion] <= #" & Format(EndDatetxt, "yyyy-mm-dd") & "#"

    Me.FilterOn = True

    End If
    End Sub

    Thanks for the help!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    You show you are using Access 2007 so I assume this is classic MSGraph charting. AFAIK, chart does not have Filter property. If you have a reference indicating different, I would like to see it.

    Apply filter to query chart is based on. Example from my db shows chart RowSource - [tbxLabNum] is a textbox on form:

    SELECT M, D, FD, ZD, ZDM FROM GraphProctor WHERE LabNum=[tbxLabNum];

    When data entry is complete, user can press a Refresh Graph button if they want to see updated chart because data must first be committed to table.

    Me.Refresh

    However, my form is filtered to a single record. If your form has multiple records, then Refresh will move focus to first record on form.
    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.

  3. #3
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186
    Hi June7
    I had not uploaded my Access version. Currently I am using office 365 with that version of Access and Yes I am using the classic MS Graph chart options
    In the past somebody shared with my an example of a Bars chart that can be updated inserting a range of number of the week but I am not sure how to this using dates
    I include this in file "Pareto chart"
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    So what do you not understand about how to modify to use date range instead of week range? For a start, table needs date/time field.

    This isn't even your actual data and database structure?

    If you use international date structure, review http://allenbrowne.com/ser-36.html
    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. Replies: 3
    Last Post: 03-07-2019, 11:04 AM
  2. Replies: 4
    Last Post: 11-25-2015, 03:04 AM
  3. Replies: 2
    Last Post: 10-27-2015, 09:12 AM
  4. Replies: 3
    Last Post: 01-09-2015, 05:48 PM
  5. Query field based upon dates in other fields
    By Demiurgous in forum Queries
    Replies: 8
    Last Post: 11-03-2014, 12:56 PM

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