Also note that the database function creates a local variable "database" but does nothing with it. When the function terminates that variable is lost. Did you intend to return it? Also it is not good practice to use the same name for a function and a variable. -- Bob Gailer 919-636-4239 Chapel Hill NC