losing yes/no data

rkapfer

Registered User.
Local time
Today, 14:39
Joined
Jul 26, 2002
Messages
14
I noticed that I'm losing data (luckly it's test data) whenever I import or export! If I export a table from one database to another the resulting databases table has lost any yes/no fields. In datasheet view the resulting table has zero's (0) or -1. I find the same thing happening if I export the table to Excel then Import it into anoter database or table. Have you a clue.
 
0 and -1 are the real numeric values of the constants "false" and "true" respectively. Thus when you say that your table has 0's and -1's, data has not been lost --- rather, for some reason, Access has simply forgotten that the field type for the field is yes no.

Have you tried simply popping open the table in design view and changing the field type for the offending field back to "yes/no"?

When you export to Excel this is quite normal. Why it is happening when you export to another Access database I'm not so sure.

Andy
 
Thanks Andy, but is there a switch, flag or control that'll prevent this?
 
Which version of Access are you running? I've just exported a table to Excel my first and the yes/no fields came across fine, Excel displays them as "true" and "false" automatically.

Are you sure that the data type for the table you're exporting is set to yes/no. Is it possible that the underlying field is actually numeric and you see "yes/no" via a control on a form?

Otherwise I'm not aware of an option to change the default way fields are exported

Andy
 
Access 2000, it loses all formats for any field defined as yes/no.
 
Sorry, I'm baffled. I'm also running A2K, and it exports fine. As a possible work around, if you're exporting this table regularly you could consider:

1. Create a new select query which contains a column for every field in the table

2. Replace the offending field with an expression:

iif([offending field name]=True,"True","False")

Which should turn the yes/no field to a text type field and give Excel no problems.

3. Export the query rather than the table.

Sorry not to be of more help.

Andy
 

Users who are viewing this thread

Back
Top Bottom