Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form closes - How can I stop it from closing? 1

Status
Not open for further replies.
Sep 10, 2003
14
CA
I have to support some older programs that were converted to Visual Foxpro from 2.6
The conversion was done such that Visual Foxpro moved what was forms into Framesets with the original form contained within it. (yuck)

I have added a simple command button to the forms pageframe page1 which does a simple check of the data, runs a preview report and doesn't call anything that closes the form.

The form however closes during the preview.
If I don't run the report the form does not close...

Is there a Magic setting that will stop the report preview from closing the form?

Here is the event tracking info just before the report form command:
45160.332, dataenvironment.BeforeOpenTables()
45160.332, dataenvironment.Init()
45160.362, screen.Moved()
45160.382, screen.Resize()
45160.402, screen.Resize()
45160.482, frsaddpick1.addpick.pageframe1.page1.cmdchkfixcosttypes.LostFocus()
45160.482, frsaddpick1.addpick.LostFocus()
45160.482, frsaddpick1.addpick.Deactivate()
45160.482, frsaddpick1.Deactivate()
45160.482, frsaddpick1.ReadDeactivate()
45160.522, frsaddpick1.addpick.Paint()


rr
 
Hello Dave,
no calls to either methods anywhere to be found.
Being a converted form from 2.6 it has code in the formset's ReadActivate, ReadDeActivate and Readshow methods.

rr
 
Sounds like the form's reference variable is going out
of scope and the form just dies.

I assume there is a "read events" active somewhere...
Hmmm...?

- Or Maybe - You have a variable collision.

i.e. Killing the form as a side effect somewhere in the
code execution path initiated by the command button.

Darrell
 
Not sure what version you're running now, but you can insert a SET STEP ON just after the last control you interact with before the problem arises and then step through each line of code until you see which one is associated with the problem behavior.

Brian
 
Hello Brian
when I trace the problem the form closes as soon as the debugger starts.
The ReadDeactivate event fires.
In VFP7 the help on readdeactivate is nil...don't use it is the essence.
In other words the conversion that was done by a long gone programmer was Q&D and is now a support problem...

Maybe I have to reinstall 2.6 and look at the help file :)

I decided to try moving the button to this form's calling form and the problem is gone.

It actually makes as much sense (or better) for it to be there so I'm going to drop that problem.

I will be moving this system to our VFE framework so I don't want to waste too much time on old 2.6 screens...

Thanks Again!

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top