Form timing errors?

G

Guest

I have a sub form that is displayed as a Continuous Form. I have a one to
many relationship between the main forms records and the sub form.

My application allows the user to select a record on the main form, the sub
form gathers all matching sub form records and displays them, with some
calculations.

The problem I am having seems to have to do with timing. I have several
summary fields on the sub forms, that rely on one another that I am getting
INTERMITTENT errors on. I have been trying to figure out the cause and am
substantially sure that this is the case. As the form is loaded and the
values are filled into the controls sometimes access is trying to assign
values based on fields that have note finished calculating yet. SO, even
though all of the values appear on the form, some of the final total fields
that rely on other fields end op with "Error" displayed.

My questions . . . What would be an elegant solution to this problem? I
TRIED adding a control.requery to the afterupdate event of the fields that I
am "waiting" on. Didn't seem to help.

The problem is NOT consistent. As I move from record to record making not
of where this occurs if I return to a "problem record" the problem usually
goes away.

In case it makes a difference I am using Access 97
 
G

Guest

Rick,
I am not sure of the best way to handle this but I can tell you I have had a
similar problem. It created data problems because a form would open before
the query was done processing. It was due to workstation speed and only
occurred on a slow workstation. You can try using the On Timer procedure to
stall the opening of the form. In my case, I calculated the value needed in
a query (qryTotalAmount) and I stored the calculated value in a hidden field
(CalcSum) on my main form and then referred to that in the subform. On the
main form the code was something like this on the On Click of the opening of
the subform:

Me.CalcSum = DMax("qryTotalAmount","TotalAmt")

Hope this helps.
 
G

Guest

I concidered doing this. I could not justify as it will cause a wait ALL the
time when it is only needed SOME time. I was hoping i would find an event or
other way I could trap the value arriving, OR trap the "error" value in the
control. When the value is updated and equals "error" refresh the form or
somethign that will re evaluate. BUT strangely often the proper caluclations
ARE done just not displayed. I did a screen print of a form with the error
just to have a hard copy, AND THE VALUES WERE THERE!

I am working on attempting to do away with the preliminary calculations
fields and simply combine them all into one so that although it may take
longer (and be more messy/ugly) the control (text box) will simply display
blank while it evaluates everything.

I really do appreciate the suggestion, this sort of brain storming often
help and even if it does not solve THIS problem (and it STILL might prove to
be the best solution!) It is a unique approach that might be a perfect
solution to something else!

Have a great day!

Rick
 
G

Guest

to be triggered by what? The update event of the controls I am waiting on? I
will give it a try, I think I did do that at one point, but at this point
I'll try anything twice just to make sure I did not overlook!

Thanks
 

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