SQL Bit datatype Mapping

  • Thread starter Thread starter Hitesh Joshi
  • Start date Start date
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
 
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
 
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.
 
Back
Top