>I have a form (frmconfirmations) that calls a .prg. From this program I want to set the form to maximized. Here is my code.
>
>
>Frmconfirmations.WINDOWSTATE = 2
>set defa to j:\gel\code
>REPORT FORM &uniqrpt NEXT 1 TO PRINT PREVIEW
>IF (MESSAGEBOX("Now do you want to print the confirmation?",36,"Print the confirmation?") = 6)
>frmconfirmations.WINDOWSTATE = 0
>REPORT FORM &uniqrpt NEXT 1 TO PRINT NOCONSOLE
>
>I set the defa to the folder that the form is in. But I get an error that says "Object frmconfirmations is not found"
>
>How should I try to change the form??
You have to pass the .PRG a reference to the form; you've assumed that there's a variable corresponding to the form matching the form's name that's in scope (both assumptions are invalid unless you've taken steps to ensure that they are true):
* In the form that calls the .PRG:
DO MyPrg WITH thisform
*MyPrg.PRG
LPARAMETERS toCallingForm
toCallingForm.WindowState = 2
*
* blah, blah, woof, woof
*
toCallingForm.WindowState = 0
*
* woof, woof, blah, blah
*
RETURN
It has nothing to do with the path, and everything to do with having a valid object reference to the form.