Filter Sub Form

  • Thread starter Thread starter travis_5579
  • Start date Start date
T

travis_5579

Hi ,

I have create a form cal frmMain , in frmMain I insert
a subform name as 'Sub_Form1'.
Sub_Form1 is set to Datasheet View and link to one of
the table.
I like to apply the
Sub_Form1.Filter ="ID='001'"
Sub_Form1.Filteron = True
but I failed to do it , please help me up.

TQ
 
open the main form in design view. *while still in the mainform design
view*, click once on the subform to select it. open the Properties box, if
it's not already open. click on the Other tab. look at the Name property,
and write down the name that shows. (that is the name of the subform
*control*, and it may or may not be the same as the name of the subform.)

if you are applying the filter from within the main form (not from within
the subform), then adjust your code as follows

Me!SubformControlName.Form.Filter = "ID = '001'"
Me!SubformControlName.Form.FilterOn = True

hth
 
Back
Top