Your code looks good to me and I thank you, but I seem to have a configuration problem (?) since all I get is an immediate error message complaining that "Database" is an a user defined data type that is not defined. This happens whether I put the code in Access VBA or into VB 6.0