Can VBA code run when user changes records?

psu_1995

Registered User.
Local time
Today, 12:10
Joined
Sep 28, 2007
Messages
13
I've been trying unsuccessfully to find a way to have some VB code run when ever the user presses the arrow buttons at the bottom of a form to move to the next (or previous) records.

All I have been able to implement is something that runs when the user moves the mouse over the detail space or if they click in the detail space. This is ok, but since the VB code is changing the background colors of text boxes depending on which fields are selected, I get a lot of screen flutter as the user is mousing around. Ideally I'd like the code to just execute once on a record change.

Is there a way to link my code to record change instead of mouse move?

Thanks,

Rob
 
Try the Current event.
 
[Forms].[Recalc] in the On Click event property will cause all the statements on the form to recalc. (the one's that depend on other objects in the form anyway)

[Forms].[Refresh] will also refresh any records that the form links to.

more on these in access help.
 
Thanks Paul!
I don't know why I didn't see the "On Current" field before in the Form properties box. It works beautifully now.
 
The ones you're looking for tend to hide, just like socks in the dryer. :p
 

Users who are viewing this thread

Back
Top Bottom