Hi, I'm Access97 user. In my master database, I had query1(select query) and query2(a parameter query asking for Dept code) and query3 (make-table query join query1 and query2 to create a table in a dept database). I'm doing this manually now. That it, I changed the destination database name to the dept I want to query about in query3 first. Then enter the dept# when query3 prompts me for Dept#. I'm thinking to do this in VBA code. I know about VBA code at certain level. Is there anyway I can define Dept# as variable, and use the Dept# passed by parameter query as the destination database name? For example, if query3 prompts me for Dept#, I entered Dept1, then VBA code will create the table for Dept1 in database Dept1.mdb. Any suggestions? Thanks a bunch.