filtering on subform

  • Thread starter Thread starter Jeannie
  • Start date Start date
J

Jeannie

I have an embedded form that holds two types of records, closed (=1) or open
(=2). I need a filter to display either closed, open or both. The
ApplyFilter Macro doesn't work.

Your help is much appreciated!
 
If you are saying you want to filter your subform records from a control on
the main form, I would suggest an option group control with 3 buttons on it.
First button labled "Closed" with an Option Value of 1, Second button labled
"Open" with an Option Value of 2, Third button labled "All" with an Option
Value of 3

Then use the option group control's After Upate event to do the filtering:

If Me.opgFilter = 3 Then
With Me.MySubformControlName.Form
.Filter = vbNullstring
.FilterOn = False
End With
Else
With Me.MySubformControlName.Form
.Filter = "[RecordType] = " & Me.opgFilter
.FilterOn = True
End With
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top