Thank you Stewart for the response. The query is not picking up the criteria from the filter for some reason. The code truns but updates all of the records under each project name?
Hi Mike. Your code does not filter the subform; it simply picks up any filter that is already set and applies it as a WHERE clause to your update of the records. I did not comment on this before, as it seemed to me that you would not have used an UPDATE statement unless you really needed to change values in records.
If you could let us know what the main form does, and what you really want to achieve when you mention filtering the subform I am sure we can advise you on how to go about it. It looks to me that the UPDATE stetement is an entirely unnecessary step if what you really want is not to update anything but to apply a filter to your subform. To filter the form you need to set its filter first, then set the form's filteron property true.
I wonder if your underlying table design is appropriate? Subforms are often used to represent tables linked in one-to-many relations, with the main form based on the one-side table and the subform the many-side (e.g. a form displaying a purchase order in the main form and the order lines (the items items being purchased) in the subform).
Please tell us a bit more about what you want to do, and the relevant fields of the tables underlying your current form/subform, so we can advise you more suitably how to proceed.
-Stewart