Jim, thanks for the suggestion. I understand READ EVENTS properly, I just put in the extra code examples to forestall peoples suggestions that I try these things. I should have made this more clear.
The part I don't get is why SHOW() or SHOW(1) fails to stop and let the form display. Like everyone else, I've got a zillion forms that call other forms and so on and I've always just used SHOW(). Using a form level property gets the job done. Sometime later, I'll dig into this. Perhaps it's the COM object that is altering the behavior. Anyway, thanks again.
Gary
>Gary,
>
>Y9u are misunderstanding the action of READ EVENTS. READ EVENTS tells VFP to go into a wait state and allow the user to take an action. It remians in effect until a CLEAR EVENTS is encountered. This means that can be ONLY ONE READ EVENTS is effect. Any additional ones are ignored. IN your sample code you instantiate the picker form and in its LoadFiles method you issue a READ EVENTS. Code execution stops right there until CLEAR EVENTS is issued. The READ EVENTS in the viewer form is ignored completely.
>
>Instead try using an approach like this outline below;
>
>
>* Start up program.
>LPARAMETERS tcMemberID, tcSourceDir
>
>SET SAFETY OFF
>_screen.Visible = .F.
>
>oViewer = CREATEOBJECT('Viewer')
>oViewer.LoadFiles(tcMemberID, tcSourceDir)
>
>READ EVENTS
>RETURN
>
>
>Remove all of the other READ EVENTS you have everywhere else!!!
>
>Now in the click event of the button in the picker form do something like this;
>
>
>LOCAL cFileName, oForm
>
>IF this.Parent.lstFiles.ListIndex > 0
> cFilename = thisform.aFiles[thisform.lstFiles.ListIndex, 2]
> IF FILE(cFileName)
> oForm = CREATEOBJECT('PdfViewer')
> oForm.DisplayPdf(cFileName)
> oForm.Visible = .T.
> oForm.Show(1)
> ENDIF
>ENDIF
>
>
>Now in the OdfViewer form provide a Quit or Exit button that does;
>
>
>Thisform.Release()
>
>
>And in you PdfPicker form also provide a Quit or Exit button that does;
>
>
>Thisform.Release()
>
>
>In the Unload event of the PdfPicker form put;
>
>
>CLEAR EVENTS
>
>
>That should make your forms work togehter well the way you want them to.