Hi Michale.
>public theyear ,themonth, tablename
>theyear=''2002''
>themonth=''06''
>tablename=''''
>
>tablename=allt(theyear)+''Äê''+allt(themonth)+''ÔÂ''
>if not used(tablename)
>....
>endif
As Chris pointed out, you need to assign an alias to the table when you open it. The problem is that the table name starts with a number (2002 in this example), which isn't a valid alias, so VFP will assign it an alias based on the workarea (such as W25). Instead, open the table like this:
IF NOT USED('MYTABLE')
USE (TableName) ALIAS MYTABLE
ENDIF
Doug