Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Results correct only on stepping in the codes (A2K SR1)

    I have a main form A which called Form B for adding records. In Form A, there is a text box which showed the total number of records in my main table. After adding records in Form B and returning to Form A, I discovered that text box didn't show the updated record number. When I did debugging and stepped into the codes, the value for the textbox was correctly shown when my cursor was over it, and after I finshed executing the codes and return to the main Form, the text box showed the correct updated record number. However, when I cleared the breakpoint and added records using Form B and returned to Form A, the text box again failed to update. When I put back the breakpoint and run again, the text box showed correctly again.

    Barring errors in my codes, why should using breakpoint and stepping into the codes give me different result from just running it without breakpoint and stepping in? What did the de###### do?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Results correct only on stepping in the codes (A2K SR1)

    Access probably forces recalculation after a breakpoint and after each step when you are stepping through code, so that you can see the effect of each step. When running without a breakpoint, recalculating all the time is inefficient.

    Try forcing a recalculation of Form A on returning from Form B. If you use a command button to close Form B and return to Form A, you might add a line like the following to the OnClick handler of the command button:

    Forms![Form A].Recalc

    As an alternative, you might put the recalculation in the OnActivate event of Form A:

    Me.Recalc

  3. #3
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Results correct only on stepping in the codes (A2K SR1)

    The solution you suggested worked very well. Thanks. Well, I have to be sure that what showed well while in debugging session worked the same while out of debug mode.

Posting Permissions

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