Solved

Need Help with Excel Export with Access 97

Posted on 2002-05-22
7
219 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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: …

628 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