Avatar of João serras-pereira
João serras-pereira
Flag for Portugal asked on

programmatically forcing a recalc of embeedded form

I am writing a software application using ms/access 2010 and VBA. In the main form I have a computed  field that is used to filter records on an embedded form.

In the embedded form, I am seeting up a filter select some of the records, depending on the additional calculations.

The problem is that as the embedded form needs to be updated as I change fields in the embedding form. because it is already open there are no events to update it.
I have tried, in the main form  to do "Forms![subform].recalc by it tells me that the subform does not exist.

What shall I do?
Microsoft DevelopmentMicrosoft Access

Avatar of undefined
Last Comment
João serras-pereira

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Use expression builder in query designer for proper syntax:
builderThen copy expression to your code.
João serras-pereira


It works. I am willing to use the "recalc" event and, at least does not crash. My background problem is not sorted though.  The recalc dos not really triggers any event thhat I can use to recalculate things.
Wich event should I use? (shall I open a separate question?)

The question you posted has been answered.

No-one here has has commented on whether the recalc method is suitable or not - that was your choice-  because we have no idea what your form is doing.

You can look at .refresh or .requery  instead of .recalc  but without a context this is just speculation.

But you should post a separate question if these suggestions do not do what you want.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
João serras-pereira

ok I am closing the question and start a new one