Timing Error

  • Thread starter Amy Blankenship
  • Start date
A

Amy Blankenship

I have a form hierarchy that's something like this:

Exam Mockup
Category
Topic
Page

There is a lot of nonstandard stuff going on, so all of the forms have a
fair amount of code going on. For instance, in the Category form, various
global variables are set for use in all the other forms, and so on down the
line. The problem I am having is that when you click the next record button
in the Topic form, the Current event happens on the Page form _before_ the
Current event on the Topic form. This means that the variables all point to
the previous Topic's information for the first record in the Page subform.

I could deal with this if there were some further event in the Page subform
that fires _after_ its parent's Current event or if there were a way to call
a function in the child form from the parent where the variables would still
be at the same scope, but I don't know if either of these things is an idea
that will work in Access.

Can anyone offer any insight into what's happening here and how to deal with
it?

TIA;

Amy
 
R

RDub

Why can you not call a function or a sub in the child from the parent? Make
the scope of the function Public and call it using the fully referenced
name. If memory serves it might look like this from the parent -> value =
subformcontrol.form.PublicfunctionName(params) or
subformcontrol.form.PublicsubName(params).

Ron W
 
A

Amy Blankenship

RDub said:
Why can you not call a function or a sub in the child from the parent?
Make the scope of the function Public and call it using the fully
referenced name. If memory serves it might look like this from the
parent -> value = subformcontrol.form.PublicfunctionName(params) or
subformcontrol.form.PublicsubName(params).

I know this may not sound like I used your suggestion, but it did get me
thinking in a different direction. What I did was just requery the subform,
which forced its Current code to run again against the correct values.
Thank you SO much for the hint! :)
 
R

Ron Weiner

Heck, whatever works is what works! I almost never spend time looking for
a better solution after I have found one that works. I am forever "On to
the next thing".

Rdub
 

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