Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 33 Times in 33 Posts

    Timing Issue (All)

    I have a line of code in both the AfterUpdate and Current events of a subform, which basically looks like this:

    WarningLabel.visible = (me.parent.txtcheckamount <> txtTotal)

    It works fine in the Current event. However, it is not working in the AfterUpdate event. Apparently it is a timing issue, since txtTotal (which is in subform footer and whose control source is "=sum(Amount)") doesn't seem to get recalculated before the equation is evaluated. I've tried using me.recalc and using DoEvents, but I can't make Access evaluate txtTotal before evaluating the equation. Any way to do this? Only alternative I can see right now is to use a DSum() in place of txtTotal in the AfterUpdate event equation.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Timing Issue (All)

    The DSum method may well be your best bet. The interaction between main form and subform is complicated, I have never been able to fathom how it works. An alternative would be to use the On Timer event of the subform to update the visibility of the label every second or so, but I try to avoid that where possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts