R
Rémi
Hi all.
I have a form with two unbound subforms. The main form has a combobox
whose selection I use to filter *both* subforms. Code called on after
update:
Private Sub cmbMyCombo_AfterUpdate()
If IsNull(cmbMyCombo) then _
cmbMyCombo=-1
if cmbMyCombo=-1 then
me.frmSubForm1.Form.FilterOn = False
me.frmSubForm2.Form.FilterOn = False
else
me.frmSubForm1.Form.Filter="myComboId=" & cmbMyCombo
me.frmSubForm1.Form.FilterOn = true
me.frmSubForm2.Form.Filter="myComboId=" & cmbMyCombo
me.frmSubForm2.Form.FilterOn = true
end if
End Sub
When cmbMyCombo has a value of -1, I want to display everything. I've
found, though, that resetting the subform's filter only works for the
first subform - the second doesn't get reset. I've also tried
Filter="", FilterOn=true, but I get the same thing.
The only thing that's worked for me so far is this:
if cmbMyCombo=-1 then
me.frmSubform1.Form.FilterOn = false
me.frmSubform2.Form.Filter= "myComboId<>-1"
me.frmSubform2.Form.FilterOn=true
else
....
Has anyone seen this? I'm using Access XP SP3.
Regards,
Remi.
I have a form with two unbound subforms. The main form has a combobox
whose selection I use to filter *both* subforms. Code called on after
update:
Private Sub cmbMyCombo_AfterUpdate()
If IsNull(cmbMyCombo) then _
cmbMyCombo=-1
if cmbMyCombo=-1 then
me.frmSubForm1.Form.FilterOn = False
me.frmSubForm2.Form.FilterOn = False
else
me.frmSubForm1.Form.Filter="myComboId=" & cmbMyCombo
me.frmSubForm1.Form.FilterOn = true
me.frmSubForm2.Form.Filter="myComboId=" & cmbMyCombo
me.frmSubForm2.Form.FilterOn = true
end if
End Sub
When cmbMyCombo has a value of -1, I want to display everything. I've
found, though, that resetting the subform's filter only works for the
first subform - the second doesn't get reset. I've also tried
Filter="", FilterOn=true, but I get the same thing.
The only thing that's worked for me so far is this:
if cmbMyCombo=-1 then
me.frmSubform1.Form.FilterOn = false
me.frmSubform2.Form.Filter= "myComboId<>-1"
me.frmSubform2.Form.FilterOn=true
else
....
Has anyone seen this? I'm using Access XP SP3.
Regards,
Remi.