here is a strange solution - i placed the following command in the command1 click and the form finally disappeared.
close window form1
i didn't know a form would respond to this command.
k
>>realized i misread and was just updating when i got your reply. no change naomi. good idea though.
>>
>>could it have something to do with the fact i am starting a new program BEFORE i exit the form entirely. in fact i exit the second program in the form (stoptwo) and it is at that point that the form actually closes - that is when the form completes the second program.
>>
>
>If you want to call the second form from your first form, add thisform.Hide() right before calling the second form.
>
>>k
>>
>>>This is not what I suggested.
>>>
>>>I suggested to only put
>>>
>>>thisform.Release()
>>>clear events
>>>
>>>in the button's click event.
>>>
>>>And put release oForm1 right after READ EVENTS in your main program.
>>>
>>>
>>>>i have that actually - without success - here is what is in my click
>>>>
>>>>Procedure command1.Click
>>>>clear
>>>>Thisform.Release
>>>>oform1.release()
>>>>CLEAR EVENTS
>>>> DO STEPTWO && this is the move to second program with new windows
>>>>Endproc
>>>>
>>>>k
>>>>
>>>>>Try implementing my suggestions into your code, e.g. add CLEAR EVENTS in the command button click after thisform.Release() and add release oForm1 right after read events.
>>>>>
>>>>>>sorry i cut off the top:
>>>>>>oform1=Newobject("form1")
>>>>>>oform1.Show
>>>>>>READ EVENTS
>>>>>>Return
>>>>>>
>>>>>>what i've done is re-postion the form directly behind the new window so it's not showing now - not so much a solution as a work-around.
>>>>>>the second program does in fact close the form after it closes it's own windows.
>>>>>>
>>>>>>k
>>>>>>
>>>>>>
>>>>>>>thisform.Release()
>>>>>>>clear events
>>>>>>>should be enough in this form.
>>>>>>>
>>>>>>>What is the code that invokes it?
>>>>>>>
>>>>>>>like
>>>>>>>
>>>>>>>loForm = createobject('Form1')
>>>>>>>loForm.Show()
>>>>>>>read events
>>>>>>>release loForm
>>>>>>>
>>>>>>>>hi naomi
>>>>>>>>it's the same code i posted in previous thread - see below - i have managed to adapt into a program quite well but having a little difficulty gertting rid of it. so adding the read events after the show form and clear events in the close is it - there must be something else i need to do in the Procedure command1.Click to make the form disappear from view.
>>>>>>>>
>>>>>>>>k
>>>>>>>>>>i am running a form within a program and everything is working fine - except when i jump over to another program, the form stays visible (in the background behind the other new windows). i have tried everything below to kill it - nothing seems to work.
>>>>>>>>>>
>>>>>>>>>>any suggestions greatly appreciated. k
>>>>>>>>>>
>>>>>>>>>>clear
>>>>>>>>>>Thisform.Release
>>>>>>>>>>oform1.release()
>>>>>>>>>>CLEAR EVENTS
>>>>>>>>>>oform1.hide
>>>>>>>>>
>>>>>>>>>What is the code that instantiates this form?
>>>>>>>>
>>>>>>>>
>>>>>>>>Define Class form1 As Form
>>>>>>>>
>>>>>>>>
>>>>>>>> Top = 3
>>>>>>>> Left = 48
>>>>>>>> Height = 100
>>>>>>>> Width = 375
>>>>>>>> DoCreate = .T.
>>>>>>>> ShowTips = .T.
>>>>>>>> Caption = "Auto Complete"
>>>>>>>> Name = "Form1"
>>>>>>>>
>>>>>>>>
>>>>>>>> Add Object command1 As CommandButton With ;
>>>>>>>> Top = 67, ;
>>>>>>>> Left = 278, ;
>>>>>>>> Height = 27, ;
>>>>>>>> Width = 84, ;
>>>>>>>> Caption = "Close", ;
>>>>>>>> TabIndex = 2, ;
>>>>>>>> Name = "Command1"
>>>>>>>>
>>>>>>>>
>>>>>>>> Add Object label1 As Label With ;
>>>>>>>> AutoSize = .T., ;
>>>>>>>> Caption = "Name", ;
>>>>>>>> Height = 17, ;
>>>>>>>> Left = 60, ;
>>>>>>>> Top = 25, ;
>>>>>>>> Width = 55, ;
>>>>>>>> TabIndex = 3, ;
>>>>>>>> Name = "Label1"
>>>>>>>>
>>>>>>>>
>>>>>>>> Add Object text1 As TextBox With ;
>>>>>>>> Format = "K", ;
>>>>>>>> Height = 23, ;
>>>>>>>> Left = 120, ;
>>>>>>>> SelectOnEntry = .T., ;
>>>>>>>> TabIndex = 1, ;
>>>>>>>> Top = 20, ;
>>>>>>>> Width = 207, ;
>>>>>>>> Name = "Text1"
>>>>>>>>
>>>>>>>>
>>>>>>>> Procedure Load
>>>>>>>> If Used("customer")
>>>>>>>> Use In customer
>>>>>>>> Endif
>>>>>>>> **** Do not need to do this if there is an Index
>>>>>>>> Set Exclusive On
>>>>>>>> ************************************************
>>>>>>>> Select 0
>>>>>>>> Use Home()+"samples\data\customer.dbf"
>>>>>>>> ************************************************
>>>>>>>> Index On company Tag company
>>>>>>>> Set Order To Tag company
>>>>>>>> ************************************************
>>>>>>>> Endproc
>>>>>>>>
>>>>>>>>
>>>>>>>> Procedure command1.Click
>>>>>>>> Thisform.Release
>>>>>>>> Endproc
>>>>>>>>
>>>>>>>>
>>>>>>>> Procedure text1.InteractiveChange
>>>>>>>> With This
>>>>>>>> If (Lastkey() >= 32 And Lastkey() <= 127)
>>>>>>>> .nIDSelStart = Icase(.nIDSelStart >= 0 And Lastkey() = 127,.nIDSelStart - 1,;
>>>>>>>> .nIDSelStart < 0,0,;
>>>>>>>> .nIDSelStart + 1)
>>>>>>>> Select customer
>>>>>>>> coldtag = Tag()
>>>>>>>> Set Order To Tag company
>>>>>>>> Locate For Substr(Alltrim(Upper(customer.company)),1,.nIDSelStart) = ;
>>>>>>>> Upper(Substr(This.Value,1,.nIDSelStart))
>>>>>>>> ***** Could use a SEEK() as well
>>>>>>>> If Found()
>>>>>>>> This.Value = customer.company
>>>>>>>> Else
>>>>>>>> If !Empty(This.Value)
>>>>>>>> .nIDSelStart = This.SelStart
>>>>>>>> Else
>>>>>>>> .nIDSelStart = 0
>>>>>>>> Endif
>>>>>>>> Endif
>>>>>>>> This.SelStart = .nIDSelStart
>>>>>>>> Set Order To Tag (coldtag)
>>>>>>>> Endif
>>>>>>>> Endwith
>>>>>>>> This.SelLength = Iif(!Empty(This.Value),(Len(Alltrim(This.Value))-(This.nIDSelStart)),1)
>>>>>>>> Endproc
>>>>>>>>
>>>>>>>>
>>>>>>>> Procedure text1.Init
>>>>>>>> If !Pemstatus(This,"nIDSelStart",5)
>>>>>>>> This.AddProperty("nIDSelStart",0)
>>>>>>>> Endif
>>>>>>>> Endproc
>>>>>>>>
>>>>>>>>
>>>>>>>>Enddefine
>>>>>>>>