<i><font color="#663300">The client is located and then to invoice, I have a toolbar click() which makes ACTIVEPAGE = 3 When Activate() is called for page 3 it loops through some functions, one of which is a call to a form which fills in the UserID (stored as a property in goApp). UserID needs to be filled for security reasons every time the invoice is accessed. The problem is that when control of the UserID form returns to the clientform it triggers the Activate() again so round we go again.</font></i>
The problem here is that you are trying to make Activate() into something it is not. Activate() in VFP fires when a page becomes active, which includes events like you describe, such as another form receiving focus and then returning back to the page.
What it sounds like you need is to run this code only when the page becomes the frontmost page, not when it receives Activate() events. The event you need is UIEnable. A page doesn't have that event, but any control on the page will receive the event when the page becomes frontmost and when it ceases to be frontmost. You could add the code to an existing control, or drop an invisible control on the page with the following code in its UIEnable() event:
<code>LPARAMETERS lEnable
IF lEnable Thisform.RunMyPage3Stuff() ENDIF
RETURN</code>
<font color="#cc0000"> ___/ / __/ / ____/</font> Ed Leafe ©2002 Ed Leafe |