2

EDIT: nevermind someone helped me. form_(name).recalc or form_(name).refresh: form_main.recalc

I have two forms: "main", "details". In the "main" form, I have a button that opens "details" in a dialog. The problem is that I have a checkbox in "details" and when in changes, I need to refresh "main". What command do that? Thank you

1
  • 2
    Please post your answer as an answer Commented Jun 21, 2011 at 17:05

2 Answers 2

4

I'm going to provide a different answer than the one you discovered for yourself:

Open the detail form with the acDialog switch, and then requery when it is closed. The event that opens the detail form would look like this (it would be in the main form):

  DoCmd.OpenForm "DetailForm", , , "ID=" & Me!ID, , acDialog 
  Me.Requery

What this does is pause the code with the detail form open. When you close the detail form, it will requery the main form.

This is the standard way of doing this kind of thing, seems to me.

Sign up to request clarification or add additional context in comments.

Comments

1

To anyone who may come behind me, the method above did not work if you are opening a pop-up from a subform attached to a main form.

What does work is change the "Got Focus" property on your main form by adding Me.Requery.

What that does is automatically requery and update the records in the form as soon as the pop-up is closed... and focus is automatically shifted to the main form.

1 Comment

....actually, I don't know how it worked the first time but it wasn't stable. Sometimes works, sometimes doesn't. Please see the suggestion below for a better fix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.