Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: alan shulman
  Where is alan shulman?
 utica
 New York - United States
 alan shulman
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: Form closing top level form
Thread ID: 331388 Message ID: 331530 # Views: 25 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Friday, December 30, 2011 8:02:45 PM         
   


> >
> >
> > Does it help to know that if I make the form Modeless it closes everything? The form only appears if its Modal
>
>
> That sounds curious but the info alone does not directly help I'd say - which one needs to be modal, is it "gradebuilder", probably the one that you call "parent"?, or the other one, which is probably the "child"?
> Perhaps posting the code calling the child form would help.
>
>
>
> -Stefan

The child table 'classgrid' needs to be Modal to appear. The Parent form 'gradebuilder' is modeless. Here is the code that calls the child form in 'gradebuilder' command button click event:
*****
IF (lfile) = ' '
MESSAGEBOX("Please Load or Create New Class")


else
DO classgrid
DO FORM classgrid
endif
******

Classgrid.prg is a program that defines the table that is behind a grid in the form 'classgrid'. Long story short, the user has created a list of student names and assignments, and this is creating a table that will store grades for each student and each assignment. For info here is that code:
****
PUBLIC colct

SET SAFETY OFF

USE 'assignments\'+(lassign) ALIAS assign
SUM(acount) to colct
CLEAR windows



DIMENSION acolumn(colct+1,4)
a=''
n=1
STORE "Student" TO acolumn(1,1)
STORE "C" TO acolumn(1,2)
STORE 20 TO acolumn(1,3)
STORE 0 TO acolumn(1,4)

GO top
DO while!EOF()

x=acount

FOR i = 1 TO x
n=n+1
a=ALLTRIM(SUBSTR(assign,1,8))+ALLTRIM(STR((i)))
store a TO acolumn(n,1)
STORE "N" TO acolumn(n,2)
STORE 3 TO acolumn(n,3)
STORE 0 TO acolumn(n,4)
ENDFOR

SKIP

ENDDO
IF FILE('grades\'+(lfile)+' grades.dbf') = .f.

CREATE CURSOR mycursor from ARRAY acolumn
CREATE TABLE gradetest FROM ARRAY acolumn
SELECT 0
USE 'classes\'+(lfile) ALIAS one
SELECT one
DO WHILE !EOF()
x=student
SELECT mycursor
APPEND BLANK
REPLACE student WITH x
SELECT one
SKIP
ENDDO


SELECT student, 000.00 as grade FROM mycursor;
into TABLE 'grades\'+(lfile)+' final'

SELECT * FROM mycursor;
into TABLE 'grades\'+(lfile)+' grades'

CLOSE TABLES
ALTER table 'grades\'+(lfile)+' grades';
ADD COLUMN final n(3,0)
CLOSE TABLES

ENDIF
USE IN assign

ENTIRE THREAD

Form closing top level form Posted by alan shulman @ 12/29/2011 4:10:48 PM
RE: Form closing top level form Posted by Stefan Wuebbe @ 12/29/2011 4:40:09 PM
RE: Form closing top level form Posted by alan shulman @ 12/29/2011 5:06:40 PM
RE: Form closing top level form Posted by Stefan Wuebbe @ 12/30/2011 9:17:02 AM
RE: Form closing top level form Posted by alan shulman @ 12/30/2011 6:02:51 PM
RE: Form closing top level form Posted by Stefan Wuebbe @ 12/30/2011 7:08:18 PM
RE: Form closing top level form Posted by alan shulman @ 12/30/2011 8:02:45 PM
RE: Form closing top level form Posted by Yuri Rubinov @ 12/29/2011 4:40:13 PM
RE: Form closing top level form Posted by Pete Sass @ 12/30/2011 7:02:42 PM