Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2007

Tip: Looking for answers? Try searching our database.

export query to excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 21 Nov 2004 04:27 GMT
I have a simple question.
I am exporting a file to excel.  My table/query has field1 that is a check
box.  When I export it, it shows as TRUE or FALSE.  Not very user friendly.  
Is there a way to modify what is outputted to excel without having to create
a new field in my table?
Basically I want the TRUE to be exported as YES and FALSE to be exported as
NO.

The query is nothing fancy, just select all from 1 table.
Here is the line of code to export the query. (Once again, nothing fancy)

DoCmd.OutputTo acQuery, "export", "MicrosoftExcel(*.xls)", "", True, "",0

Your assistance is appreciated,
Steve Schapel - 21 Nov 2004 05:02 GMT
David,

In the design view of your table, look at the Format property of the
Yes/No field.  If it is formatted as True/False, you could try changing
it to Yes/No and see if that does the trick.  If not, go to the design
view of the "export" query, and similarly check the Format property of
the field in question... it probably won't have any entry at the moment,
so you could set it to Yes/No, and see if that does the trick.  If not,
you can make a calculated column in the query, in the place of the
existing Yes/No field, like this...
 NewYesNo: Switch([YourYesNoField]=-1,"Yes",[YourYesNoField]=0,"No")

Signature

Steve Schapel, Microsoft Access MVP

> I have a simple question.
> I am exporting a file to excel.  My table/query has field1 that is a check
[quoted text clipped - 10 lines]
>
> Your assistance is appreciated,
David - 22 Nov 2004 16:19 GMT
Thank you Steve,
The line of code in my query worked perfectly.

David

> David,
>
[quoted text clipped - 22 lines]
> >
> > Your assistance is appreciated,
HOW1 - 08 Oct 2007 10:17 GMT
David,

Can you tell me where you enter the following code for exporting queries to
excel as I'm trying to do something similar.

Regards

> Thank you Steve,
> The line of code in my query worked perfectly.
[quoted text clipped - 28 lines]
> > > Your assistance is appreciated,
> > >  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.