do******@hotpop.com wrote:
I'm surprised that the Current event of forms always fires twice
(Access XP).
I have quite a lot of processing done in the current event, how to make
the code run just once?
Are you are referring to it running twice when a Form (or is it a
subForm) first opens? I've seen this and it seems that there is nothing
you can do to stop it from running twice, but you can put in a test to
see if it is the first time or subsequent times. What seems to happen is
that the Current Event fires when the Form first opens, before the
recordsource is loaded, and then again after it has the recordset and
arrives on the first record. Unfortunately any test for the existence of
the recordsource (or its clone) produces an error if it doesn't yet have
one. You could trap that error so it doesn't get displayed. I don't know
off the top of my head what circumstances actually cause it, but I have
definitely had it happen to me too.
--
Bri