Question : Make Table Query but save it in a New Database

Hello Everyone,
I built a Make Table Query (the SQL Version is in the Code Section) which work fine but I wanted to give the flexibility to my user to save the table in new database. So what I would like to do is the following:
1. User Presses a button and the Save File dialog box comes up.
2. User decides where to save the file
3. Before the Query Runs a File is created in that location called "Template"
4. The information from the Make Table Query is downloaded in the Template.mdb file

is there a way to do this?
Code Snippet:
1:
2:
3:
4:
SELECT EARNS_Data_tbl.RDepositorAcct, EARNS_Data_tbl.RItemTimeStamp, EARNS_Data_tbl.RDepositorName, EARNS_Data_tbl.RCheckAmt, EARNS_Data_tbl.RCheckNumber, EARNS_Data_tbl.RTransaction, EARNS_Data_tbl.RMakerName, EARNS_Data_tbl.RPayee, EARNS_Data_tbl.RDraweeMICR, EARNS_Data_tbl.RMakerAcct, EARNS_Data_tbl.RDepositDate, Reaseon_Codes_tbl.Code_Description INTO DataExtract IN 'C:\Documents and Settings\joe\Desktop\R2080558.mdb'
FROM EARNS_Data_tbl LEFT JOIN Reaseon_Codes_tbl ON EARNS_Data_tbl.RReasonCode = Reaseon_Codes_tbl.Reason_Code_ID
WHERE (((EARNS_Data_tbl.RDepositorAcct)=IIf([Forms]![PowerUserForm]![AccountGrp_Report]=1,[RDepositorAcct],[Forms]![PowerUserForm]![Account_Number_Report])) AND ((EARNS_Data_tbl.Date_Processed) Between [Forms]![PowerUserForm]![Start_Date_Report] And [Forms]![PowerUserForm]![End_Date_Report]))
ORDER BY EARNS_Data_tbl.RItemTimeStamp, EARNS_Data_tbl.RCheckAmt DESC;

Answer : Make Table Query but save it in a New Database

You can use the create DB sql see the following link followed by the make table sql

http://www.w3schools.com/sql/sql_create_db.asp
Random Solutions  
 
programming4us programming4us