Solved

Need Help with Excel Export with Access 97

Posted on 2002-05-22
7
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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:Tom 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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