This is probably a very simple question however I've looked all over and can't seam to get this small statement to work correctly.
-Setup / Background Information-
I have a form that enters records about items into a table using a query. The query feeds into a listbox that updates and shows what records are in the query. I also have a textbox+button that you can type anything it and it will search any of the fields in the query and it will filter the query and display it in the list box. Under that there is a "export to excel" button which I have it open a new small popup window which allows you to select a filepath from a combo box.
-The problem-
The exporting form gathers information from the main record entering form and builds a file name and exports using docmd.transferspreadsheet. It worked fine until I tried to add 2 textbox values to the file name.
DFrom = Date From which is an unbound textbox that is masked for dates (01/01/2009)loc = Nz(filepath, "C:\")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Forms![tracking form]!lstRecordSearch.RowSource, _
loc & [Forms]![tracking form]![DFrom] & [Forms]![tracking form]![DTo] & ".xls", True, ""
DTo = exact same as DFrom and is just for the To Date
I hit export with this bound to a button and nothing happens