Hi Peter,
I also found, that setfocus() of some of the page objects invokes Page.Activate. To prevent unnecessary code execution, I created the following workaround:
I added a new form's property called nLastActivePage and set it to 0 in Property Sheet.
In Page.Activate I check, if nLastActivePage<>1 (for the first page) or (2 for the second page, you probably can use PageOrder, but I just coded with numbers), and if it's not equal, I set it to 1 or 2 and execute code, otherwise I don't execute it.
Hope this helps.
>HELP!! I have a form with a pageframe. In one of the pages ACTIVATE method, I call a couple SQL SELECTS that build up a couple cursors as well as preloading some data.
>
>Somehow, I am getting into a continuous loop into the ACTIVATE function where the only way out is the dreaded CTRL-ALT-DEL.
>
>If I step through the code with the debugger - it fires fine. What am I missing here. I thought the ACTIVATE only fires when that page on the pageframe comes active - once, shouldn't it under normal cicumstances? If it matters, I get to that page by calling....
>
>thisform.pageframe1.activepage=4
>
>
>I put a WAIT WINDOW in the ACTIVATE so I could see if that was what was looping. Could a WAIT WINDOW or a SETFOCUS (for a listbox on this page), cause the ACTIVATE to fire multiple times?
>
>Hope someone knows what I am doing other than going nuts!!
If it's not broken, fix it until it is.
My Blog