Update Subforms/Popup

C

celineusa

Hi All!


On a main form, I have a subform (1) which is a continuous form that
displays records from table A. On the Form Footer of that subform, I
have a button that open another continuous form in a popup (2). On that

popup continuous form, I have a button next to each record that adds
the record to table A and then close the popup form.
Now, I would like subform (1) to update the results from table A as
soon as form (2) is closed.
I know that the code has to be when I click on the button... I tried:
Me.Parent.Subform1.Form.Requery
Me.Parent!Subform1.Form.Requery
The same without parent, the same without form, but each time, I get
different error messages...
Any suggestions?


Thank you
Celine
 
M

MacDermott

There is no parent-child relationship between your main form and the popup
form.
So you'll need to reference the main form by name.
If it's frmMain, you could use
frmMain.Subform1.Form.Requery

Do you want to be able to interact with the main form while the popup form
is open?
If not, instead of just making it pop-up, make it modal as well.
That way, your code execution (from the button on your subform) will be
suspended until the popup form is closed. So you can just use
Me.Requery
after your DoCmd.OpenForm ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top