>Thanks Gregory, your solution is perfect!
>May I ask another quick question? I have a command button on a form that appends records from one table into another and the records being appended all have the same date. Can you help with an IF....EndIf statement that will prevent the records from being appended if the dates for the records are already there (because the user may have previously performed the append but is trying to do it again and I don't want the same names with the same dates appended twice).
>
>The sql I am using now is:
>SELECT table2
>Append From table1
>
>Thanks again!
>Max
Max,
you may give this a try
You need an index on table2 to check whether a record has already been appended
select Table2
append from Table1 ;
all for !IndexSeek(table1.field1+Table1.Field2, .F., 'Table2', 'TagInTable2')
or
Select Table1
scan all
pk = Table1.field1 + Table1.Field2 + ...
if( !seek(pk, 'Table2', 'TagInTable2') )
insert into Table2 (fld1, fld2, ..) values( table1.fld1, table1.fld2, ...)
endif
endscan
Gregory