Solved

Need Help with Excel Export with Access 97

Posted on 2002-05-22
7
213 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views 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 Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now