>IF mwebenable > thiswebfile=&mwebpath+'jobsweb.dbf' > thiswebfile1=&mwebpath+'applweb.dbf' > USE &thiswebfile1 IN 0 > SELECT applweb > SET ORDER TO 1 > IF !USED('&thiswebfile') > USE &thiswebfile IN 0 > ENDIF > SELECT jobsweb > SET ORDER TO 1 > SEEK mponum > .... > .... > SELECT applweb > USE IN applweb > SELECT jobsweb > USE IN jobsweb >ENDIF >>
* Get used to using the m. prefix for memory variables * so there's no chance of a memvar name conflicting with a column name in a open table m.mWebPath = "C:\Some \Path \With \Spaces" * You'll often want to use ADDBS( ), which will add a trailing backslash if not already present * With that you can USE ( ADDBS( m.mWebPath ) + "JobsWeb.dbf" ) IN 0 * This is a clean way to close a table, whether it's already open or not, and whether * the current work area is JobsWeb or not: USE IN SELECT( "JobsWeb" )If that doesn't help I recommend tracing in the debugger. I suspect there's a lot more going on than the code you posted, maybe that table is being opened somewhere else.