SQL Bit datatype Mapping

H

Hitesh Joshi

Hi,

I've a Bit datatype field in my back end SQL table. On my MS Access
2003 form I'm using TextBox to Display the value of this Bit field. I
can choose On/Off, Yes/No..
Is there a way I can map this Bit field to display string of my
choice? I.e. Open/Closed?
Table is linked through ODBC.

Thanks in advance,
hj
 
H

Hitesh Joshi

Hi,

I've a Bit datatype field in my back end SQL table. On my MS Access
2003 form I'm using TextBox to Display the value of this Bit field. I
can choose On/Off, Yes/No..
Is there a way I can map this Bit field to display string of my
choice? I.e. Open/Closed?
Table is linked through ODBC.

Thanks in advance,
hj

So basically I want to format the TextBox, Bit value 0 = Open and 1 =
Closed (or vice versa)
In access it might be 0=Open and -1=Closed

I tried putting Open/Close in 'format' string , where I can select yes/
No but it did not work.

Any hints?

hj
 
D

Douglas J. Steele

Hitesh Joshi said:
So basically I want to format the TextBox, Bit value 0 = Open and 1 =
Closed (or vice versa)
In access it might be 0=Open and -1=Closed

I tried putting Open/Close in 'format' string , where I can select yes/
No but it did not work.

While more than a tad ugly, you could use the following Format string:

"\C\l\o\s\e\d;\C\l\o\s\e\d;\O\p\e\n"

What this does is put the literal "Closed" if the number is positive or
negative, or the literal "Open" if it's 0. If you wanted something else to
appear if the field is Null, you'd put another semicolon after \O\p\e\n and
put what you wanted there.
 

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