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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Filter subform records using Textbox on main form

Status
Not open for further replies.

HGoodloe

Programmer
Sep 4, 2008
53
US
I’m working on a project using a main form and subform. When the main form first opens, the subform will be invisible… On the main form I would like to use a textbox and command button to display filtered records in the subform based on a code number entered in the textbox, at which point the subform will become visible along with the filtered records.

While I realize that this is probably a simple process, yet I’m having no luck getting it to work. So, as a last resort, I’m turning to you guys, the experts. I would greatly appreciate your help.

I’m already using a combo box on another form that don’t require filtered records, but for this particular project, I need and prefer to use a textbox to filter records in the subform.
Thanks so much.
 
you can link the subform to the textbox and the filtering happens automatically.

assume your text box is "txtBxFilter"
and it links to the field in the subform "projectID"

In the subform control

linkMasterField:[txtBxFilter]
linkChildField:[projectID]

I would use a combo box instead because they are choosing only from the available codes. Set the combobox limit to list = true. And it is a combo so they can still type it in if they want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top