apply filters to subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I dont know if my conception is right (may be somebody can advise better),
but what i want is:
while the form is for "single" input, i want in the right part to appear the
"continuous" lists of records similar to the current one filtered by this or
that criteria.

So what i did - i made one subform based on the same source as the form and
was trying to apply different filters on it.

Then i thought that the "Tab" view would look nice - so i made 4 tabs with
same subform on each (each "child" is named differently) and managed to link
child-master fields for the 2 of them so it really shows what i want.

the other 2 tabs - i got problem. Tried to set filter "on click" for tab's
heading, but somehow insuccessful...

1st tab needs to filter subform by 2 criteria:
Me.MainForm.DocType1 = Me.SubForm1.DocType1
AND
Me.MainForm.Project1 = Me.SubForm1.Project1
(Main form and sub-form have similar names for fields)

and 2nd tab needs to show all records where
Me.SubForm2.FollowUp1=true

Please can anybody help me with the code and advise where to place it?

Thank you.
Lana
 
You refer to the subforms filter property like this:
Forms!MainFormName!SubFormName.Form.Filter = "DocType1 = " &
Me.DocType1 & " And Project1 = " & Me.Project1
Forms!MainFormName!SubFormName.Form.FilterOn = True

For your second one:
Forms!MainFormName!SubFormName2.Form.Filter = "Followup1 = True"
Forms!MainFormName!SubFormName2.Form.FilterOn = True

Hope that helps!
 
Hi Jeff

I tried that one:
Private Sub Follow_ups_Click()
Forms!CorrOutgoing!CorrOutFollowUp.Form.Filter = "FollowUp1 = True"
Forms!CorrOutgoing!CorrOutFollowUp.Form.FilterOn = True
End Sub

....and nothing happens.....

shouldn't the tab control be addressed here somewhere? (this
"CorrOutFollowUp" child is on the 4th page of the "TabCtl46")

or could it be connected with some problem which i am experiencing with this
"CorrOutgoing" form? - when i open it - it showes no records. and only after
i press button "Apply/Remove Filter" - it showes all my records. (sometimes i
have to press it 2-3 times to get full list) This is very strange and i
cannot find reason (i got no conditions set "on open" neither on the button
which opens this form from another form)

but after i press "Apply/Remove Filter" button the other pages of the Tab
show correct filters, but "follow up" still doesnt work...

i am lost.... :(
Please help!!!
Thank you.
Lana
 
Back
Top