Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Feb 2004
    Thanked 0 Times in 0 Posts

    slow table update (2002)

    Hi, I have a form with which I am attempting to update a table using a sub routine. Once data is entered into a control, the after update event triggers the sub. The sub queries the underlying table using an sql statement, for historical data and attempts to add the new data to the old data, to provide a total which is then used elsewhere.

    The problem i have is that access does not update the underlying table quickly enough once data has beeen entered or changed in the control. The result is that the recordset produced by the sql statement does not include the new record or modification of an existing record unless i manually step through the program - giving access time to update the underlying table.

    Is there anyway of slowing down or delaying the subroutine whilst the underlying table is updated, or at least forcing the table to be updated before the sub kicks in?


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

    Re: slow table update (2002)

    If I understand your description correctly, your code runs in the After Update event of a control on the form. When this event occurs, the value of the control has been changed, but the record has not yet been saved. It is probably better to put the code in the After Update event of the form; this event occurs after the record has been saved. Alternatively, you could force the record to be saved by inserting code as follows:

    If Me.Dirty Then
    RunCommand acCmdSaveRecord
    End If

    but if you do this in the After Update event of a control, the user would lose the ability to undo changes to the control, and it will cause a lot of overhead if you have to do this for several controls on the form.

Posting Permissions

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