>thisform.grid2.recordsource = MySQL + MyWhere + " into table " + cLocalPath + "Temp"
WOW! This is a really bizarre way of creating a table. I'm surprised it does work sometimes...
The recordsource property can hold the alias name of a cursor, the name of a table, the name of a query file (QPR), or an SQL expression (I assume you are using this setting of the RecordSourceType property)
In any case, it is intended as a reference to an existing cursor, or to a query expression which may
retrieve the data. Placing "action" SQL commands there (i.e. SELECT INTO..., or INSERT INTO ... etc) may have unpredictable results: when / how many times / with which error handling, is the command executed?
By all means, the right way to do this (in my opinion) should be:
lcCommand = MySQL + MyWhere + " into table " + cLocalPath + "Temp"
&lcCommand
thisform.grid2.recordsource = cLocalPath + "Temp"
Try this, it should work. Even if it doesn't, i.e. because the path does not exist, you'll get an "nice and fixable" error in the &lcCommand line!
Hope this helps,
Jose.