Focus Problem

5ilver

New member
Local time
Today, 11:53
Joined
Nov 22, 2009
Messages
3
Hi

I have a continuous subform in a main form. Each time a user updates a field in the subform a function is triggered which loops through the record set and calculates some values that are then displayed on the main form.

The problem is that the focus always ends up on the last record of the recordset after the function runs and not where the user has clicked. Is there anyway I can stop this happening?

Many thanks in advance.
 
Sounds like you can just set the focus with the code.... at the end... last line.. something like..... Me.TextboxWhatever.SetFocus
 
You could NOT use a loop to do that and just put a hidden control that has your math in the subform's footer, then just reference that control in your main form.
 
Or you could have a hidden calculated field with this function in it that calculates at the record level as a running sum and pull that out onto your main form, making the calculation real time per record instead of calculating everything in the entire recordset over everytime you make a change.
 

Users who are viewing this thread

Back
Top Bottom