Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Display A Check Box - Just get Yes or NO. What's UP?

Status
Not open for further replies.

Culby

Technical User
Dec 9, 2001
13
US
I want to display a Yes/No field in a form displaying as a checkbox. If it's checked, its "Yes". If its not checked, its "No". Simple right? Wrong!

I can get this type of display in a query display. I can get it when I put it in a form, BUT...... When I use the same form as a subform inside another form, the data is displayed as Yes or NO. What gives? I've tried every property setting I can think of but nothing works. Is this possible?

Please help, my head is already black and blue from hiting it against the Microsoft Wall.

Thanks,
Culby
 
This one's actually fairly simple, but, let's take a step backwards for a moment.

Given that boolean data (yes/no or true/false) is one of the data types which offers a variety of controls to use for its display, its wise to give thought to your display preferences while your laying out your "core" database objects, namely, your tables!

As such, if check boxes are your preferred display type for a yes/no datatype, set it as such in the table design for that field. With the affected field highlighted in table design view, select the "Lookup" tab for the field properties and change the "Display Control" to a check box.

Having done that, when you design a query based upon that same field, it will default to a checkbox when you display the query results. Similarly, when you subsequently design a form based upon that table or query, that field's display control also carries through to the form, in this case, a check-box.

Here's my guess at what you've done:

1) You used the Form Wizard in the creation of all the form's/subform's you mentioned.

2) The affected table (the one with the yes/no field) has that field's "Display Control" set to "Text Box" rather than "Check Box". NOTE: Once you declare the check-box display control in the table design view, you cannot over-ride it in a query i.e. the query will always display that field as a checkbox in query datasheet view.

3) I'm also guessing that your form or subform is set to a "DataSheet" view, which abides by the underlying table's field "Display Control" properties. Otherwise, you would have simply replaced the form's Text-Box control with a Check-Box control for that one field. Datasheet forms, however, require that you comply with the underlying table's Display Controls.

Hope this helps rebuild the otherwise untarnished Microsoft wall !!!
 

zerosandones ...
Thank you for the reply! I think you are exactly right. BUT... as unplausible as it may sound, here is what happened. I did as you suggested and you were right! I did somehow change the display setting for my main table under the lookup tab for the Yes/No field. I had selected a textbox display. On changing to the checkbox display, this immediately changed the data display of the table and of the query based on the table but did not change the subform displayed by itself or the subform displayed as a subform.

...the plot thickens..... Being supiscious, I closed out of everything including access. Upon restarting access I got the same result! The checkbox type display was shown for the table and for the query but not for the form displayed by itself or displayed as a subform (which is based on the same query which is based on the same table). Needless to say this was quite confusing. BUT..... after checking, changing, going in and out what seems like a hundred times, I discovered that the forms will change the Yes/No display to the checkbox display if you go in and then close out of the database and access TWO TIMES! I have done this twice. The first time back the forms do not change their display for this Yes/No field. The second time back they do! Granted, I am geting a littly slap happy with the Keyboard so I could have changed something else but I don't think so. After sending this message, I'm going to check it again to see if this is the case. (did I tell you I'm using Access 97?) Anyway thankyou very much for the tip. Anyone else getting a tip from zerosandones should pay attention because he knows what he is talking about!

Thanks again,
Culby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top