Solved

Need Help with Excel Export with Access 97

Posted on 2002-05-22
7
215 Views
Last Modified: 2010-08-05
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
0
Comment
Question by:Rachy222
7 Comments
 
LVL 12

Expert Comment

by:James Elliott
ID: 7027385
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
0
 
LVL 1

Author Comment

by:Rachy222
ID: 7027509
i had already tried that and it did not work,

any other ideas
0
 
LVL 1

Author Comment

by:Rachy222
ID: 7027557
can someone please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 54

Accepted Solution

by:
nico5038 earned 200 total points
ID: 7027640
Perhaps there's a "\" missing?
To be sure test:
IF right(me.txtOpenFile,1) = "\" then
  expPath = me.txtOpenFile
else
  expPath = me.txtOpenFile & "\"
endif

Nic;o)

0
 
LVL 12

Expert Comment

by:James Elliott
ID: 7027661
what error message where you given?

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

Thanks

Jell
0
 
LVL 5

Expert Comment

by:knowlton
ID: 7028049
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
0
 
LVL 12

Expert Comment

by:James Elliott
ID: 7029119
Points share Nico?
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question