Can I have a tickbox toggle a Byte Field from 1 to 0 ?

I

Isis

I want to use a Tick Box to toggle a Byte field on and off on a form - the
Form is already displaying data from a Table ('Control') - the field is
'Preview' and is a Byte Field - I don't really want to change the type of
Field in the Table itself.

As a side point - my Control Table is a 'one record' table control file -
not sure if this is the best way to do this sort of thing in Access (I am a
database programmer, just not an Access person !). How can I limit the file
to a single record ?

Thanks for any help
 
D

Douglas J. Steele

I'm not sure it's possible. A check box returns True (-1) when checked, and
you can't store -1 in a byte field.

Why don't you want to change the data type of the field (to Boolean)?
 
I

Isis

I'm not sure it's possible. A check box returns True (-1) when
checked, and you can't store -1 in a byte field.

Why don't you want to change the data type of the field (to Boolean)?

Hi Douglas, Thanks for the reply.

I don't want to change the type in the Table as I have a lot of code that
refers to this field and it's all coded for If Preview=1 or Preview=0 and
i am assuming an Access Yes/No does not provide that value ?

I have not done a lot of Access (VB) coding, but I wrote this project for
someone to 'bolt on' to an exisiting DB. They took my code and used it
where they wanted to in their DB and I don't really want to mess with the
back end as I don't want to be responcible for what goes wrong ! I write
DB, but not in Access, and I would never use the 'text' type fields that
are being used here to store on/off toggle states, but we are where we
are now.

Can I just use an 'unbound' tick box and intercept the value and adjust
my Control field accordingly ? Is that easy to do and where do I do the
intercepts ?

Thanks again.
 
D

Douglas J. Steele

As I said, a check box returns -1 when checked or 0 when not. You can use
the Abs() function to convert that to 1 or 0.
 

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