SET TALK OFF oChangeDataPath = CREATEOBJECT('datafolder') oForm = THISFORM oChangeDataPath.curfolder(oForm) RELEASE oChangeDataPath RELEASE oFormThat gets changed if the form is in a formset, which it isn't at the moment. My dataenvironment.AutoOpenTables = .F. for every form. The .curfolder method of my datafolder object looks like this:
PARA oFormcalled * This class resets the paths of tables in the data environment * to CURDIR() IF PARAMETERS() = 0 RETURN ENDIF IF TYPE("oFormcalled.DataEnvironment") = "O" oEnviron = oFormcalled.DataEnvironment ELSE RETURN ENDIF IF TYPE("oEnviron") = "O" nTotMem = AMEMBERS(aMems,oEnviron,2) WITH oEnviron IF .AutoOpenTables = .F. && which it should be * Check for cursors FOR i = 1 TO m.nTotMem IF UPPER(EVAL("."+aMems[m.i]+".BaseClass")) = "CURSOR" WITH EVAL("."+aMems[m.i]) * Get the current path of the database STORE .Database TO cDB cDB = SUBSTR(cDB,RAT('\',cDB)+1) .Database = SUBSTR(FULLPATH(cDB),1,RAT('\',FULLPATH(cDB)))+cDB ENDWITH ENDIF ENDFOR .OpenTables() && the error occurs on this line ENDIF ENDWITH ENDIF RELEASE oEnvironThe error mentioned in the title occurs at the .OpenTables() line, but only if I go into the form, out and into another form, then back into the first form once or twice. It may be relevant that one of the forms that is opened has a private data session. The "Object is not contained in a form" is really error 1938: Object is not contained in a (name). It doesn't seem relevant to this bit of code.