Selasa, 28 Juni 2011

Re: [MS_AccessPros] Three state (Yes, No, blank) controls

 

Hi Gary,

the Yes/No data type is a byte, it only supports 2 values. You can make your field an Integer and change the DisplayControl to a checkbox using this code:

CurrentDb.TableDefs("Table1").Fields("Field1").Properties("DisplayControl") = CInt(acCheckBox)

Allen Browne has an excellent article on this:

Why I stopped using Yes/No fields
http://allenbrowne.com/noyesno.html

Warm Regards,
Crystal

www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*

--- On Tue, 6/28/11, Gary D. Schwartz wrote:

> Hi:
>
> I am trying to replicate in an Access form a feature found
> in other
> db software.
>
> In other software, you can have a check box that has three
> possible
> states: "Yes" or 1, "No" or 0, and blank. "Yes.shows as a
> check mark,
> "No" shows as a blank white box, and blank shows as gray on
> the form.
>
> The Access checkbox has two states:  "Yes" or 1, "No"
> or 0.
>
> We would like to do this to separate the "No" answers from
> the cases
> where nothing was ever entered (blank, NULL, missing).
>
> If I need to, I can do a combo box, but thought a check box
> format
> would be faster and more elegant.
>
> Any thoughts?
>
> Thanks,
> Gary
>
> --------------------------------------------------------
> Gary D. Schwartz         

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar