Thanks again teddy. It seems as if you are going to be my personal saviour as far as Access is concerned! As for my SQL query problem, I have resorted to dumping the results into a temporary table, but this really churns up the database and makes compacting a daily task. Don't suppose you know how to programmatically compact the database when the user closes it (I read that you can't have the database open to compact it). I'm using a client/server arrangement so the client mde needs to compact the data mdb that sits on the server. Obviously, it will be allowed to fail if other users have the database open.