Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering a subform using a combo box on the main form

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
i know this forum is littered with this request but for some reason i cant get any of the the answers to work for me.
The one bit of code that keeps popping up is this one
Me.YourSubForm.Form.Filter = "[FieldName] =" & Me.YourComboBox
Me.YourSubForm.Form.FilterOn = True
but i keep getting the error
"Run-time error '2465':
access cant find the field 'subfrmNewIssues' referred to in your expression.
You may have misspelled the field name, or the field may have been renamed or deleted"

But its not a field its a form.
This is my version of the code above which i placed in the after update event of the main forms combo box

Me.[subfrmNewIssues].Form.Filter "[SystemApplication] =" & Me.Combo55
Me.[subfrmNewIssues].Form.FilterOn = True

i hope someone can help me.

"My God! It's full of stars...
 
Have a look here:

You may also play with the expression builder (loaded forms) to discover the name of the control hosting the subform

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
What about changing the recordsource based on the combo's value and then requerying the subform?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top