We help IT Professionals succeed at work.
Get Started

Record Source contains form being loaded

codequest asked
Last Modified: 2012-08-14
I've got three forms on a Main form: Activity, Milestone, NextStep.  

They are linked hierarchically, but not using parent child, because they aren't subform relationships.  When Activity is current, it requeries Milestone, which requeries NextStep, pulling up the nested/associated records for both.

I want to roll up the highest priority from NextStep to Milestone and then to Activity.

The queries to do this work have a problem.   If I put the maxpriority of Milestones associated with forms!Activity.ActivityID = MilestoneActivityID  in the Recordsource for Activity, then it fails on form load because form Activity is not open.  The recordsource can't find Activity so it can't find the current Activity form record ActivityID value to use to filter Milestone priorities to generate the maxpriority.

I built at test button, so I can load Activity without the maxpriority in the recordsource, then push the button and switch the Activity record source to include maxpriority.  That works fine; the appropriate maxpriority values from associated Milestone records appear in Activity.

I can't figure out a way to do this automatically on form load or open without the button.  I tried to use the AfterFinalRender event, but it failed.  

When I think about it, I can't see how it could possible NOT be a circular reference problem, because the recordsource references the form VALUES, which depend on the recordsource.  Of course I may be missing something obvious, like record current, that fires later?

Otherwise I'm thinking there would have to be some sort of timed event, or some other manually triggered event, like my button or maybe recordcurrent.

Any suggestion on this would be appreciated.

Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE