Thanks to all, I have narrowed down my problem - and posted another question about how to correct it. It appears, my custom status box, a small form centered in the display, that I call in place of the WAIT WINDOW is the culprit. When I call it during the PAGE.ACTIVATE event it works fine UNTIL I close it at the end. When that happens, the PAGE.ACTIVATE fires again, thus looping itself. Removing it solves the problem, but I still need a status box for slow machines so that is the new post in the FORM section of the UT.
Thanks for all your help - it led me to locate the culprit - now If I can fix it, that would be even more the better.
>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!!
Peter Brama
West Pointe Enterprises
VFP is getting easier but STILL alot to learn!!