Filter in subform

colmtourque

Registered User.
Local time
Today, 22:29
Joined
Sep 26, 2002
Messages
83
I can see this problem has been talked to death but I saw nothing that works for me.

I have a mainform with a textbox, based on data entered in that textbox I would like to filter the subform.
I would also like to be able to do a between statement. But we can wait on that.

I used this found here on the forum
Forms![SubformName].Form.Filter "[FieldName] =" & Me.Txtboxname
Forms![SubformName].Form.FilterOn = True
Forms![SubformName].Form.Requery

Please some coding genious have pity on this person and tell him where he messed up this code

confused
Tourque
 
If you want to do Between And later then I suggest you base the subform on a parameter query and have the query get the parameter from the text box on your main form. Then using Me.SubformName.Form.Requery in the text boxes After Update event will show you the filtered data in your subform based on the criteria in the text box.

hth,
Jack
 
Not sure I understand what you are saying. But trying it.
The form is already based of a query. I am trying to run several possible filters off of it. Two of which are:
1) Based on a specific month
2) Based of specific time period (January 5 2002 - March 2 2002)
Another might be no filter what so every

Doing what you are saying though seems to lock the text box.
How do I get around that it is enabled and not locked
 
Last edited:
Sorry I had it bound to a control source.
Thanks, that worked great, by the way and now I can also tie this to a command button and then Do Several Nifty things with it. (the data is on several tabed sheets so now I can use the field in the form footer and buttons on the tabs to save space.)

Thanks again
 
You are welcome and I am glad that you got it sorted and working!

Jack
 

Users who are viewing this thread

Back
Top Bottom