The best way to handle this is to use Macro substition for the table name. For Example;
nTable1 = Form.Entryfield1.Value //(An Entryfield on a field for the user to enter the new table name)
nTable2 = Form.Entryfield2.value
Select 1
Use &nTable1 Tag SomeField
Select 2
Use &nTable2 Tag someField
Set Relation to Somefield into &nTable1
Also you can use a predictive naming convension for the table name by replacing the Entryfields with a Program segment like
nTable1 = "EMP" + Substr(DTOC(DATE()), 1, 2) +;
SUBSTR(DTOC(DATE()), 7, 2) + ".DBF"
This would result in a table named, "EMP0602.DBF"
Each month the table name would change, July would = "EMP0702"
you would probabley want to test that the file exists before executing these command with code like;
IF File("C:\Tables\EMP" + Substr(DTOC(DATE()), 1, 2) +;
SUBSTR(DTOC(DATE()), 7, 2) + ".DBF"
Good luck feel free to let me know if you have questions.
RRiley