Select SYSOPTIONS If EMPTY( OPAFOLDER) && If location of Output A table not known = MESSAGEBOX( "You have not yet defined the Service Details Table Folder in which to" + CHR(13) + ; "store the Service Details Analysis Data. First you will need to do this via" + CHR(13) + ; "the System Options Form.", MB_ICONSTOP, "No Service Details Folder/Directory") Thisform.cmdRunAnal.Enabled = .F. Else && there is a location for Output A table lcOPAFolder = ALLTRIM( OPAFOLDER) lcOPAPath = lcOPAFolder + "OutputA.dbf" If not ( FILE( lcOPAPath)) && But no Output A table there = MESSAGEBOX( "Service Details Data Table, 'OUTPUTA.DBF', does not exist in System Options' " ; "specified folder, " + ALLTRIM( lcOPAFolder) + "." + CHR(13) + ; "Possibly it was deleted or moved to another location." + CHR(13) + ; "The system will now create the table in the specified folder.", MB_ICONINFORMATION, ; "No Service Details Data Table - System will Create") Wait WINDOW "Creating Service Details Data Table, 'OUTPUTA.DBF' ..." NOWAIT NOCLEAR lcDef = SYS(5) + SYS(2003) Set Default To ( lcOPAFolder) Select csrOutputA && Used as template Copy Structure to OutputA Set Default To ( lcDef) Wait CLEAR EndIf not FILE() ... USE ( lcOPAPath) In 0 Exclusive Alias OutputA Select OutputA ... EndifTo complicate matters the user can have any number of "Working Area Directories" (WADs), under which are database folders. I've got a test WAD set up C:\Temp6. The dev. system is in C:\MCL_Windows. Now to the code: