Link to home
Start Free TrialLog in
Avatar of Lou Dufresne
Lou DufresneFlag for United States of America

asked on

MS Access 2007 - Main and SubForm - Return to current record

I have a mian and subform where I display on the main form a violation level valie in a field. This violation value is calculated from an event on the sub form. The subform can have many records so the calculation is recalculating all the values in these rows.
The event on the sub form is on the after update of a drop down box. The user selects a value from the subform dropdown box and it is updated and displayed in the main form. The code initiated from the after update of the drop down box on the subform is:
Private Sub Violation_Level_AfterUpdate()
If Me.Violation_Level = "3-Severe" Then
     Me.ViolationPoints = 3
     Me.Parent.Recalc
  End If
End Sub

Because of the code line  Me.Parent.Recalc, the screen is recalculated and the subform also recalc and it then displays the first record in the subform list which is usually not the record the user was working on.

Question: I need some ideas on how to return the user to the record they were originally working on before the code was run to recalc the value.

Any Assistance would be appreciated
LAD

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lou Dufresne

ASKER

Perfect. It worked perfectly  Thanks