Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    CoZak is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    May 2018
    Posts
    33
    Last but not least this is the code I use
    Code:
    Private Sub cmb_bound_AfterUpdate()
    
    q_get_measurement_subform.Form.Filter = "[Bound]='" & Me.cmb_bound.Text & "'"
    q_get_measurement_subform.Form.FilterOn = True
    
    
    
    
    End Sub
    
    
    Private Sub cmb_kp_AfterUpdate()
    
    
    q_get_measurement_subform.Form.Filter = "[KP]= " & Str(Nz([Screen].[ActiveControl], 0))
    q_get_measurement_subform.Form.FilterOn = True
    End sub
    etc...



    but if i set a filter, it works but if i sent another, the first one goes away, how can I keep the other filtered and the filter another one?

    Thanks!

  2. #17
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Maybe check to see if a filter exists, and if so concatenate new criteria with AND

    Code:
    Private Sub cmb_kp_AfterUpdate()
    
    if len(q_get_measurement_subform.Form.Filter) > 0 then
        q_get_measurement_subform.Form.Filter = q_get_measurement_subform.Form.Filter & " AND [KP]= " & Str(Nz([Screen].[ActiveControl], 0))
    else
        q_get_measurement_subform.Form.Filter = "[KP]= " & Str(Nz([Screen].[ActiveControl], 0))
    end if
    q_get_measurement_subform.Form.FilterOn = True
    End sub

  3. #18
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You can modify the graphs source in the same VBA event (http://www.accessmvp.com/strive4peace/Access_Graphs.htm) Build the SQL dynamically like you do for the subform than assign it to the graph's row source property.

    Cheers,
    Vlad

  4. #19
    CoZak is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    May 2018
    Posts
    33
    Hey davegri, sadly your code doesnt work, it returns 0 values, i ve tried to change it and tweak it a bit with no success

    Vlad, I havent managed to assign a subform as the graph s row source .... the closest i ve come is [subform].[form] but it still doesnt work as intended, I tried using another query where I d filter according to the subform but no luck there either...

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 02-27-2014, 08:25 PM
  2. Query wont show records with a blank field
    By bignate in forum Queries
    Replies: 2
    Last Post: 09-03-2013, 04:45 AM
  3. Replies: 4
    Last Post: 05-11-2013, 07:51 AM
  4. Replies: 12
    Last Post: 02-10-2013, 10:13 AM
  5. Replies: 1
    Last Post: 08-16-2012, 01:51 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