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,
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,
> > >