Data returned on check boxes

G

Guest

We have check box controls on a form. When it is exported to SAS, a check
mark is read as a '0', and no check mark is read as a '-1'. Is there a way
to alter this to have a value of '1' for a check mark, and '0' for no check?
We are designing forms for a study whose accompanying codebook listed '0' and
'1' for unchecked/checked and we would like to be able to keep these values
and not have '0' and '-1' unchecked/checked. These fields should remain
single check boxes (as opposed to option groups).

Thanks,
 
K

Ken Snell [MVP]

You can change the value during the export by using a calculated field in a
query instead of the normal field. You would use a field similar to this:

MyOutputField: -[OriginalNameOfField]

But, if you're doing an export directly from a form's recordset (not using a
query via TransferText or some other export process), then the answer likely
is "no".
 
V

Van T. Dinh

The CheckBox Control on the Form deosn't matter.

What matters is that Access/JET Boolean Field has 2 possible value: 0
representing False/No and -1 representing True/Yes. When a Boolean Field is
exported to another format, 0 and -1 will be exported.

If you need to export True/False as something different from -1/0, you will
need to
use a Calculated Field in a Query and export the data from the Query.
 
J

John Vinson

We have check box controls on a form. When it is exported to SAS, a check
mark is read as a '0', and no check mark is read as a '-1'. Is there a way
to alter this to have a value of '1' for a check mark, and '0' for no check?
We are designing forms for a study whose accompanying codebook listed '0' and
'1' for unchecked/checked and we would like to be able to keep these values
and not have '0' and '-1' unchecked/checked. These fields should remain
single check boxes (as opposed to option groups).

True/Yes/Checked is stored as -1, False/No/Unchecked is stored as 0 -
I think you may have your assignments backward!

I'd suggest exporting from a Query with a calculated field:

ExpField: Abs([field])

The Abs() function will convert the -1 True value to +1, and leave the
0 alone.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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