As everyone else has told you, you need to set the recordsource of a grid to "" before changing the recordsource. If you don't any custom properties and methods are lost.
This is by design according to Microsoft. I think the thinking is that if you change the recordsource you no longer want the custom behavior to be in effect any more.
PF
>When I change the record source of the grid I am losing
>the code in the header click events.
>What can I do ?
(On an infant's shirt): Already smarter than Bush