Addendum. Thought that maybe something might be closing the table, so...

Adding this code to the function for debugging:
	Boolean bIsOpen bShared
	Integer iMode
	Get_Attribute DF_FILE_OPENED of CODEMAST.File_Number to bIsOpen
	Get_Attribute DF_FILE_OPEN_MODE of CODEMAST.File_Number to iMode
        Move (iMode = DF_SHARE) to bShared
	If not bIsOpen ;
	    Open CodeMast
Shows that the table is open (bIsOpen shows "true" in the debugger), iMode is 0 and bShared is true.