My suggestion is to rethink the design. Either non-modal or modal with tabs or expanding the modal form if needed. Modal on Modal is messy and sometimes confuses the user if they want to close the app, it refuses and they sometimes can't figure out why. (I've seen this happen).
>I am encountering the long-standing VFP bug that sometimes afflicts calling a modal form from a modal form. In my case, the called form ends up behind the calling form, the close boxes of both are disabled, and the only way out is to press Esc a couple times to close both forms. (Ugh!)
>
>Poking around online, one suggested fix is to put the following code in the Activate of my forms --
>
>IF Thisform.WindowType = 1
> Thisform.AlwaysOnTop = .T.
> Thisform.AlwaysOnTop = .F.
>ENDIF
>
>-- but that does not work for me. Other than going modeless (e.g., Paul Mrozowski's suggested alternative to modal), are there any other possible fixes worth trying?
>
>-m.
>
>(P.S. FWIW, to others who might be grappling with this: Getting an initial grip on the problem was difficult, because the behavior was intermittent. I was finally able to determine that, in my case, the behavior was only occurring when I tabbed between controls on any of modal forms in the "stack" before calling the problematic form -- i.e., if Modal1 calls Modal2 and Modal2 calls problematic Modal3, then Modal3 exhibits the problematic behavior only if I have tabbed between controls in either Modal1 or Modal2 before calling Modal3.)
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer