drmojo418
New Member
- Joined
- Apr 12, 2005
- Messages
- 8
i have a form that has a button that when clicked send the info from my query:
here is the sql code for my qry.
SELECT dbo_InventoryFairfield.CRCallDateTime, dbo_InventoryFairfield.ArrivlDate, dbo_InventoryFairfield.CRCallResultCode, dbo_InventoryFairfield.Office, dbo_InventoryFairfield.FirstName, dbo_InventoryFairfield.MiddleInt, dbo_InventoryFairfield.LastName, dbo_InventoryFairfield.SpouseName, dbo_InventoryFairfield.Address, dbo_InventoryFairfield.City, dbo_InventoryFairfield.State, dbo_InventoryFairfield.Zip, dbo_InventoryFairfield.CRAreaCode, dbo_InventoryFairfield.CRExchange, dbo_InventoryFairfield.CRNumber, dbo_InventoryFairfield.BusPhone, dbo_InventoryFairfield.Rate, dbo_InventoryFairfield.VfrCamp, dbo_InventoryFairfield.NoAdults, dbo_InventoryFairfield.NoKids, dbo_InventoryFairfield.Comments1, dbo_InventoryFairfield.CcAmt1, dbo_InventoryFairfield.CcAmt2, dbo_InventoryFairfield.CcAuthorize1, dbo_InventoryFairfield.CcAuthorize2, dbo_InventoryFairfield.CrsID2, dbo_InventoryFairfield.Email, dbo_InventoryFairfield.CRAgentID, dbo_InventoryFairfield.VfrID
FROM dbo_InventoryFairfield
WHERE (((dbo_InventoryFairfield.CRCallDateTime)>[Start Date mm/dd/yy] And (dbo_InventoryFairfield.CRCallDateTime)<[End Date mm/dd/yy]) AND ((dbo_InventoryFairfield.CRCallResultCode) Like "S*") AND ((dbo_InventoryFairfield.Office) Like "SD"));
and here is the code for my onclick event for my button. (which when clicked being that it comes from the same code as the form it asks for a start and end date)
here is the vb code:
Function SD_exportToExcel()
DoCmd.TransferSpreadsheet transfertype:=acExport, _
spreadsheettype:=acSpreadsheetTypeExcel9, _
tablename:="qrySD_Sales", _
filename:="C:\MY DOCUMENTS\SD_dailySales.xls", _
hasfieldnames:=True
End Function
The function listed above works but it overwrites the old spreadsheet. i need to just append the data to the previous spreadsheet. could someone help me with this.
thanks
chad
here is the sql code for my qry.
SELECT dbo_InventoryFairfield.CRCallDateTime, dbo_InventoryFairfield.ArrivlDate, dbo_InventoryFairfield.CRCallResultCode, dbo_InventoryFairfield.Office, dbo_InventoryFairfield.FirstName, dbo_InventoryFairfield.MiddleInt, dbo_InventoryFairfield.LastName, dbo_InventoryFairfield.SpouseName, dbo_InventoryFairfield.Address, dbo_InventoryFairfield.City, dbo_InventoryFairfield.State, dbo_InventoryFairfield.Zip, dbo_InventoryFairfield.CRAreaCode, dbo_InventoryFairfield.CRExchange, dbo_InventoryFairfield.CRNumber, dbo_InventoryFairfield.BusPhone, dbo_InventoryFairfield.Rate, dbo_InventoryFairfield.VfrCamp, dbo_InventoryFairfield.NoAdults, dbo_InventoryFairfield.NoKids, dbo_InventoryFairfield.Comments1, dbo_InventoryFairfield.CcAmt1, dbo_InventoryFairfield.CcAmt2, dbo_InventoryFairfield.CcAuthorize1, dbo_InventoryFairfield.CcAuthorize2, dbo_InventoryFairfield.CrsID2, dbo_InventoryFairfield.Email, dbo_InventoryFairfield.CRAgentID, dbo_InventoryFairfield.VfrID
FROM dbo_InventoryFairfield
WHERE (((dbo_InventoryFairfield.CRCallDateTime)>[Start Date mm/dd/yy] And (dbo_InventoryFairfield.CRCallDateTime)<[End Date mm/dd/yy]) AND ((dbo_InventoryFairfield.CRCallResultCode) Like "S*") AND ((dbo_InventoryFairfield.Office) Like "SD"));
and here is the code for my onclick event for my button. (which when clicked being that it comes from the same code as the form it asks for a start and end date)
here is the vb code:
Function SD_exportToExcel()
DoCmd.TransferSpreadsheet transfertype:=acExport, _
spreadsheettype:=acSpreadsheetTypeExcel9, _
tablename:="qrySD_Sales", _
filename:="C:\MY DOCUMENTS\SD_dailySales.xls", _
hasfieldnames:=True
End Function
The function listed above works but it overwrites the old spreadsheet. i need to just append the data to the previous spreadsheet. could someone help me with this.
thanks
chad