That looks right to requery one of the subforms.
I prefer a different method by raising custom events. That way, the Add/Edit Vendor form doesn't have to specifically know what to update and won't throw an error if the form is opened from the DB window without the main form open. It requires a little more coding but is much more flexible.
In the declaration section of the Add/Edit Vendor form, declare a custom event:
Code:
Public Event AllDoneHere()
The form's OnClose event, raise the custom event:
Code:
Private Sub Form_Close()
RaiseEvent AllDoneHere()
End Sub
In the declaration section of your main form, declare a module level object variable for the Add/Edit Vendor form:
Code:
Private WithEvents AddEditForm as Form_[the forms actual name]
Also in the main form, select AddEditForm from the left dropdown list (Object list) and AllDoneHere from the right dropdown list (Procedures). The editor will create a new code block for the custom event. Add the code to requery the subforms:
Code:
Private Sub AddEditForm_AllDoneHere()
Me.PurchaseOrderSubform.Form.Requery
Me.OtherSubformName.Form.Requery
'... Anything else you want to do after closing the AddEditForm ...
Set AddEditForm = Nothing
End Sub
The biggest difference is how you open the Add/Edit Vendor form. Rather than DoCmd.OpenFom "Add/EditVendor" method, you create a new Instance of the form. This is easily accomplished using this method:
Code:
Public Sub cmdOpenAddEditForm_Click()
Set AddEditForm = New Form_[actual form name]
AddEditForm.Visible = True
End Sub