0
votes

I have a form with subform. The subform has the recordsource in a query named my_subform_query. The subform shows the query result and allow to filter the content with few comboBox in the father form. The query source is a LEFT Join. I need to update all records shown in subform but no the rest shown by the query.

How can I do this if the me.recordsource is the query my_subform_query

thanks in advance

edit: Sorry I want to mean to execute a update query with CurrentDb.Execute "UPDATE table..." to update a True/false field...

1

1 Answers

0
votes

From the parent form call:

Me!NameOfYourSubformControl.Form.Requery

From/in the subform itself call:

Me.Requery

To update, you would use the RecordsetClone of the subform:

Dim rs As DAO.Recordset

Set rs = Me!NameOfYourSubformControl.Form.RecordsetClone

While Not rs.EOF
    rs.Edit
        rs!YourTrueFalseFieldName.Value = True  ' or = False
    rs.Update
    rs.MoveNext
Wend

Set rs = Nothing

No requery of the subform will be needed.