Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it a Bug? Troubles setting ".FilterOn=False"

Status
Not open for further replies.

tanolalano

Technical User
Jul 7, 2003
27
0
0
IT
Hi all,
In my DB i had a form with 2 unbound and unlinked subforms (the subforms are unlinked each other).
The mainform is only a container that have two subfrm.
In the main form I have one unbound combo to filter both subfrms with the same parameter. I use the filter property to set the filter string. So when i set "filterOn=True" in the afterupdate event of combo it works for both subforms. But when I set by button ".filterOn=False" for both subForms it works only for the first line I've declared...i.e.

Code:
[COLOR=green]'----This code always works[/Color]
Private Sub CmbClient_AfterUpdate()
      [Analisi_Cass_Dare].Form.Filter = "Ragione_sociale ='" & Me.CmbClient & "'"
      [Analisi_Cass_Dare].Form.FilterOn = True
      [Analisi_Cass_Avere].Form.Filter = "Ragione_sociale='" & Me.CmbClient & "'"
      [Analisi_Cass_Avere].Form.FilterOn = True
End sub
[COLOR=green]'-----This code works only for the first line. If I change 'the order of the lines (to 2 1) it reset filter for the 2nd line not for the 1st [/Color]
Private Sub Comando24_Click()
    [Analisi_Cass_Avere].Form.FilterOn = False  'line 1
    [Analisi_Cass_Dare].Form.FilterOn = True    'line 2
End Sub

Is it a bug or what?

Thanks
 
Are you aware that this line:

[Analisi_Cass_Dare].Form.FilterOn = True

says True, not False?
 
Sorry Remou,
I copy the wrong sub in the 1st post

The code is :
Code:
[COLOR=green]'----This code always works [/color]
Private Sub CmbClient_AfterUpdate()
      [Analisi_Cass_Dare].Form.Filter = "Ragione_sociale ='" & Me.CmbClient & "'"
      [Analisi_Cass_Dare].Form.FilterOn = True
      [Analisi_Cass_Avere].Form.Filter = "Ragione_sociale='" & Me.CmbClient & "'"
      [Analisi_Cass_Avere].Form.FilterOn = True
End sub
[COLOR=green]'-----This code works only for the first line. If I change 'the order of the lines (to 2 1) it reset filter for the 2nd line not for the 1st [/color]
Private Sub setFilter_Click()
    [Analisi_Cass_Avere].Form.FilterOn = False  'line 1
    [Analisi_Cass_Dare].Form.FilterOn = False    'line 2
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top