Yes/No Data Type format when exported to a spreadsheet

M

MarieT

Hello,

I have a Yes/No flag defined in my table, query and report with the Format
field property set to "Yes/No", and the Display Control property set to "Text
Box" or "Combo Box". I would like the field to display Yes/No as opposed to
True/False. This works fine when I run the query and display its content.
It also works fine when I run a formatted report. However, when I export the
Query to a spreadsheet, whether via DoCmd.TransferSpreadsheet, or the Export
Dialog, the content of the field in the spreadsheet is TRUE/FALSE. How can I
make it export YES/NO instead?

Any help will be greatly appreciated.

MarieT
 
J

Jeanette Cunningham

Marie,
you need to use a calculated field in the query for that field.
In a new column in the query in design view,
in the Field row, type something like this:

Expr1:IIf([FieldName]=-1,"Yes", "No")

Replace Expr1 with a name for this field to appear in the exported file.
Replace FieldName with the name of your yes/no field

Export this calculated field instead of the yes/no field.


Jeanette Cunningham
 
M

MarieT

Thank you so much! Jeanette and Klatuu! This worked!

Klatuu said:
Use a calculated field in your query:

YN: IIf([YesNoField] = True, "Yes", "No")
--
Dave Hargis, Microsoft Access MVP


MarieT said:
Hello,

I have a Yes/No flag defined in my table, query and report with the Format
field property set to "Yes/No", and the Display Control property set to "Text
Box" or "Combo Box". I would like the field to display Yes/No as opposed to
True/False. This works fine when I run the query and display its content.
It also works fine when I run a formatted report. However, when I export the
Query to a spreadsheet, whether via DoCmd.TransferSpreadsheet, or the Export
Dialog, the content of the field in the spreadsheet is TRUE/FALSE. How can I
make it export YES/NO instead?

Any help will be greatly appreciated.

MarieT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top