Solved

Need Help with Excel Export with Access 97

Posted on 2002-05-22
7
212 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

747 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

11 Experts available now in Live!

Get 1:1 Help Now