Results 1 to 4 of 4
  1. #1
    ErikaGu is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    3

    Unhappy Link multiple charts based on crosstab to a multiselect listbox and date in a form

    Hi,



    I'm trying to have a form in which a user can make selections in a listbox and would be able to enter a date range to filter data in order to generate charts.
    The thing is that the way I've built my project is: 1 form = 1 subject = 1 chart.
    So, invidually, it works fine.

    IE: If I wanted to know the status of the work done in the "Reg" department based on WorkerIDs, I could go to the "Reg" form and generate a chart.
    If I wanted to know the number of absence based on AbsenceID, I could go to the "frmAbsence" and generate a chart for it.

    However, I'm asked to create one single form in which a user can filter data and generate all charts.

    How can I do this?

    I've tried to set the Child/Master Link in the property of the second charts, but I'm having an error saying Microsoft Access doesn't recognize a field.

    Thanks!
    Last edited by ErikaGu; 09-18-2018 at 11:04 AM.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the query would use the objects on the form:
    qsFilter1Worker: select * from table where [dateFld] between forms!myForm!txtStartDate and forms!myForm!txtEndDate and [WorkerID] = forms!myForm!lstWorkID

    the chart uses the query.
    then when user changes the listbox selection, refresh the report
    Code:
    sub lstWorkID_afterupdate()
      me.Chart.requery
    end sub

  3. #3
    ErikaGu is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    3
    Quote Originally Posted by ranman256 View Post
    the query would use the objects on the form:
    qsFilter1Worker: select * from table where [dateFld] between forms!myForm!txtStartDate and forms!myForm!txtEndDate and [WorkerID] = forms!myForm!lstWorkID

    the chart uses the query.
    then when user changes the listbox selection, refresh the report
    Code:
    sub lstWorkID_afterupdate()
      me.Chart.requery
    end sub
    Hi ranman,

    Thank you for the answer.

    I'll try to implement the changes and will come back at you asap.

  4. #4
    ErikaGu is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    3
    Hi,

    I added the following code to "qReg"
    Code:
    SELECT *
    FROM tReg
    WHERE [DatePlanned] between forms!frmReg!txtFromDT and forms!frmReg!txtThruDT and [WorkerID] = forms!frmReg!lstWorkID;
    And the

    Code:
    sub lstWorkID_afterupdate()
      me.Chart.requery
    end sub
    But after selecting items from the listbox, the chart is not changing. Why is that?

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

Similar Threads

  1. Adding Records from MultiSelect ListBox
    By Voodeux2014 in forum Forms
    Replies: 3
    Last Post: 10-16-2015, 09:22 AM
  2. Multiselect Listbox
    By wwhit in forum Forms
    Replies: 19
    Last Post: 03-09-2015, 02:58 PM
  3. Replies: 8
    Last Post: 11-11-2013, 08:39 PM
  4. Replies: 4
    Last Post: 06-24-2013, 07:34 AM
  5. Listbox multiselect status
    By Sam23 in forum Programming
    Replies: 5
    Last Post: 03-06-2012, 01:13 PM

Tags for this Thread

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