query filter

cmw

Registered User.
Local time
Today, 16:36
Joined
Jan 21, 2008
Messages
46
I have two subform in main form.
Main form is unbound form. I have 2 queries such as detail query,summary query. summary query is summary of detail query by sum(amount) groupby code. subform1 recordsource is detail query.subform2 recordsource is summary query. My problem is I select a combobox value , atonce detail query filter by combo value, and then result reflect by summary query,detail query. How will do it?
Another doubt I write subform1 current()
Me.Parent![subform2].Form.Filter = "
Code:
 = " & Me.Code & ""
   Me.Parent![subform2].Form.FilterOn = True
   Me.Parent![subform2].Requery
It work well. But First time it will show follow err msg
[QUOTE] You entered an expression that has an invalid reference to the property Form/Report[/QUOTE]. Why?
 
Well, first of all this is an invalid reference:

Me.Parent![subform2].Requery

It should be:

Me.Parent![subform2].FORM.Requery

You need to tell Access to requery the subform, not the subform container control, which is what you should be referencing in your code, not the subform itself (the subform container can be named the same as the subform, but it isn't necessarily so).

Check here for more on that:
http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx
 

Users who are viewing this thread

Back
Top Bottom