I have a DB with a Qry Table for 3 Fields that I pull off data from an Excel Spreadsheet. Now I want to insert them into a Table that we use to get reports out for yearly/monthly numbers. Now I want to have it to insert them into the fields of X Month in testing its October for the cost and October_Minutes for the Minutes. So far this is what I have. But when I do an Insert into command it just appends them at the end. I want them to insert with the users matching name. IE so that the cost for the User matchs the User Name. Thanks.


'Importing of all data for the month.
Dim MonthData As String
MonthData = InputBox("Enter File Path:", "Month Data", "C:\Documents and Settings\wdwoodhams\Desktop\Aug.xls", 1440 * 4, 1440 * 3)
'Temp Table
DoCmd.TransferSpreadsheet , acLink = acSpreadsheetTypeExcel9, "tmpCell", MonthData, True

'Qry to pull all data that is needed to be put into the "Core" database for that month.
DoCmd.RunSQL "CREATE TABLE Qry (User_Name varChar, Minutes varChar, Charges varChar)"
DoCmd.RunSQL "INSERT INTO Qry(User_Name,Minutes,Charges) SELECT [User Name],[Total Min#],[Total Charges]FROM tmpCell"
If Combo1 = "October" And Combo3 = "2003" Then
DoCmd.RunSQL " INSERT INTO Test([Name],[October_Minutes],[October])SELECT [User_Name],[Minutes],[Charges]FROM Qry"
End If

'Remove Temp Table after adding in new month data
DoCmd.RunSQL "DROP TABLE tmpCell"
DoCmd.RunSQL "DROP TABLE Qry"

Billy