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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close a specified from from the prg 2

Status
Not open for further replies.

mike777

Programmer
Jun 3, 2000
387
US
I feel foolish asking this question, but I have beat my head against the computer screen for several hours now.
I have scoured the Help files and tried everything there, plus all kinds of unlikely combinations of suggestions they have there (what's up with FoxPro Help files anyway...they don't believe in examples??)
Anyway, I've tried:
forms."myformname".release
form."myformname".release
forms.'myformname'.release
forms.'myformname'.release
myformname.release
"myformname".release
'myformname'.release
myformname release
forms![myformname].release
forms!"myformname".release
form![myformname].release
form!"myformname".release
form![myformname].release

...I'll spare you the rest...
I've stumbled across:
_screen.activeform.release
and this does work OK, but obviously, it's not always sufficient.
1) Can you help?
While we're at it (hope it's an acceptable practice to ask two questions...), I also have:
report form (cReportPath+'myReport') PREVIEW
2) Is there a way to have the window that this report shows up in default to being maximized?
Thanking you in advance...
-Mike
 
Hi Mike,
1. DO FORM myForm NAME myForm LINKED
myForm.Release()

2. Regarding the Report window.. there is a FAQ by mgagon on thies.

oRepForm = CREATEOBJECT("Form")
WITH oRepForm
.Caption = "My report Title"
.WindowState = 2 && This will maximize the form
.Show()
ENDWITH
REPORT FORM (rptFile) PREVIEW WINDOW (oRepForm.Name) ;
TO PRINTER PROMPT
oRepForm.Release()


Hope this solves your problem :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
when you do the form, add the name clause:
do form forms\myformname name oMyformname

then you can release it with:
oMyformname.release
 
It's a miracle!!
Thanks!!
The question I have for you now (if you will), is what do you do when the form name has a space?
I've tried:
"my form name".release()
[my form name].release()
and I get "Command verb not recognized"...
 
Form names can't have spaces in them, so there really isn't a good answer to your question! Don't confuse the Name property with it's Caption.

Rick
 
Hmmm...my FoxPro (v 7.0) allows spaces. I checked the list of Forms in the Project window and also the files behind the forms. Spaces in both locations.
Any suggestions?
Thanks!!
-Mike
 
mike777

I would suggest if you are to use the NAME clause that you don't put spaces in it:

DO Form "my beautiful form.scx" NAME "myForm" LINKED


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
As for showing the report preview maximized, it also works to add the following to the BeforeOpenTables of the report dataenvironment (even if the report uses the default data session and environment)

zoom window 'Report Designer' max
 
mike777

Is there a way to have the window that this report shows up in default to being maximized?

Take a look at faq184-1762. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top