Filter Sub Form

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
 
T

tina

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
 

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

Top