Link to home
Start Free TrialLog in
Avatar of Rachy222
Rachy222Flag for United States of America

asked on

Need Help with Excel Export with Access 97

I am exporting a table to an excel spreadsheet.

i want to export it to a path that i am typing in at  txtOpenFile


here is what i have so far

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "qryContractsLbbExport", "LBB EXCEL EXPORT", True

i need to know where in the code to tell it to look at the path i have typed in  in the txtOpenFile text box

thanks
Avatar of James Elliott
James Elliott
Flag of United Kingdom of Great Britain and Northern Ireland image

Try this

Dim expPath as string

expPath = me.txtOpenFile.text

DoCmd.TransferSpreadsheet (acExport, acSpreadsheetTypeExcel7, "qryContractsLbbExport", expPath & "Example.xls", true)

Or something like that.

Let me know if this helps.

Thanks

Jell
Avatar of Rachy222

ASKER

i had already tried that and it did not work,

any other ideas
can someone please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ASKER CERTIFIED SOLUTION
Avatar of nico5038
nico5038
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what error message where you given?

I can't see any reason for it not working?

Thanks

Jell
Here is a working example from my source code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryABC", strSaveFile, True

Where strSaveFile =

"V:\Reports\" & Format(Date, "mm-dd-yy") & " " & Forms![frmPipelineSelect]![Combo6] & ".xls"

Hopefully you can take this and modify it to suit your needs.

Tom
Points share Nico?