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

Dynamic filtering of a form

Status
Not open for further replies.

Datathumper

Technical User
Jan 26, 2004
46
CA
I am hoping that someone can help me with a little problem that I am having...

I have a combo box on a form that looks up a value from tbl_main, field "Mark No" I want it to dynamically filter the attached subform, which draws from the same table, same field as a value is typed in the combo box. Basically as a letter or number is typed into the combo, I want it to filter the subform on values that start with that number or letter, then when the combo is emptied again, I want it to show all fields.

Is this possible or one big headache??

Thanks in advance..
 
What is the RecordSource of the subform ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
In the AfterUpdate event procedure of the combo:
Me![name of subform's control].Form.Filter = "[Mark No} Like '" & Me![name of combo] & "*'"
Me![name of subform's control].Form.FilterOn = True
Me![name of subform's control].Form.Requery

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I keep getting an error, "object doesnt support this property or method" and then it highlights the top row of the following:

Me![Mark No].Form.Filter = "[Mark No] Like '" & Me![Combo6] & "*'"
Me![Mark No].Form.FilterOn = True
Me![Mark No].Form.Requery

ANy ideas?
 
And this ?
Me![Mark No].Filter = "[Mark No] Like '" & Me![Combo6] & "*'"
Me![Mark No].FilterOn = True
Me![Mark No].Requery


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thnks for the alternate suggestion, but nope...same problem

I have even tried
[frm_main].Form![Mark No].Filter = "[Mark No] Like '" & Me![Combo6] & "*'"
[frm_main].Form![Mark No].FilterOn = True
[frm_main].Form![Mark No].Requery

still the same error....

I do appreciate your assistance with this.

THanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top