Give this a try:
- Add a property called lAbort and set it to .t.
- In the Load method, add this code:
DODEFAULT()
IF ThisForm.lAbort
RETURN .f.
ENDIF
- In the Data Environment OpenTables method, add this code:
NODEFAULT
IF FILE('JUNKX.DBF')
DODEFAULT()
ELSE
ThisForm.lAbort = .t.
ENDIF
>Typically I open the tables manually in a form's load (close them in the form's unload) and return .f. if the tables do not exist, etc so the form never loads, but:
>
>When autoopentables is .T. and the dataenvironment is used to open/close tables:
>
>is there was a way to cancel the form's load if a table does not exist by checking for its existance in the beforeopentables event of the dataenvironment? I have tried this by returning .f. but it appears that the data environment still attempts to open the form and returns the failure to instantiate object error message and then fails to load the form.