Share via

form running total

Anonymous
2011-08-23T18:41:53+00:00

I have a form with several fields requiring input.  I also have a total at the bottom to sum all these fields.  Here is my problem.  No mater what I try the total will only refresh after you have finished inputing a new number and hit enter, or left the field.  I want the total to recalculate as you are typing in the numbers.  This way there will never be a missunderstanding.  I've tried Afterupdate, Beforeupdate, Keychange (for the field that is being changed) and Change (for the form itself).  None of these work.  Any ideas?

Thanks.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-08-23T18:57:11+00:00

Doable, but tricky. You have to save the record after each capture. That is doable with

    Me.Dirty=false

in the OnChange procedure event handler. Note that doing so, the cursor moves at the end of the text, so yo may have to play with SelStart:

Private Sub Text1_Change()Dim start As Long start = Me.Text1.SelStart    Me.Dirty = False Me.Text1.SelStart = startEnd Sub

You may also have to force a Me.Recalc, to handle the case where there is no text at all actually typed, etc.

Also note that the record "is saved" (unless an error occurs, because a required field is missing a value, or other reason) ecah time the text changes. That is quite "chatty"  and un-usual.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-08-29T11:18:11+00:00

    You can also try

    Me.Text1.SetFocus

    Good Luck

    Lyn

    Was this answer helpful?

    0 comments No comments