>I have code in the beforeopentables event of the dataenvironment that changes the cursorsource to use the correct path and table. The code basically gets the path name from a table based on the alias name of the cursor. I need to put some error handling in this code and if an error occurs, I need to close down the form. Is it possible to do this? Is there a better way to get the correct cursorsource for a table? I am using free tables due to FPW2.6 legacy applications sharing the same tables.
>
>
>TIA
If there is an error, store a string value ("ERROR" for example) in the Datasession.tag Then put code like this in the LOAD of the form...
IF ALLTRIM(This.DataSession.Tag) = "ERROR"
RETURN .F.
ENDIF
Returning .F. from the LOAD event prevents the form from being created. Note that the Destroy event will not fire.
David.
David.