You can't keep properties that are set at runtime. The most common method to do this is to design a table in your database that holds a tablename, keyfieldname, and lastkey. Then write a stored procedure or prg or method that gets the next sequential number for whatever table you need a key. If it is for some other purpose just use some name in the tablename field like: mykey
HTH
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California