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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

yes/no data type in combo box limited to list

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
Hallo,
I'm having a problem trying to set a yes/no field. In the field properties in the table I say yes/no type but I would like it to be as a combo box and not as a check box. Easy (you would say), set it as combo box. That's what I did, but then you must specify the origin of the row and this will creates conflict when the database is used by a computer with another language setting (german or french), because the yes/no type want a ja/nein oui/non depending on language setting, and it conflicts with the origin row that is set to "yes" "no"....
Does someone is so kind to tell me what I'm doing wrong?

thanks
 
you could in the properties of the cbo type in the value's you require
row source type = value list
"Yes";"No"

Hope this helps
Hymn
 
hallo hymn,
actullay that is what I was trying to do, and it will work if all the user use the same language. But if some users (and this is the case) uses a german version of access it will cause problems. The combo will display "ja" and "nein" because of the field type, but then if try to choose one it will say that the choice it's not part of the list, because in the value i put "yes" "no"....
 
You make the field in the underlying table that it is bound to a Yes/No field but it is actually stored in the table as -1 or 0 resp.


So make the combo box RowSource = -1;Yes;0;No
Column Count = 2
Column Width = 0;
Bound Column = 1

That binds the -1/0 to the field in the table but displays "Yes"/"No"

( this won't change for different language settings though.
If you want it to you'll need to detect the language setting in the Form_Load event and change the RowSource accordingly.)



'ope-that-'elps



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Hang On.

There's an easier way.


Add a text box control to the form and bind it to the Yes/No field in the table.
Then make the text box control's Format property = Yes/No

It then displays Yes or No


MS 'elp
You can set the Format property to the Yes/No, True/False, or On/Off predefined formats or to a custom format for the Yes/No data type.

Setting

Microsoft Access uses a check box control as the default control for the Yes/No data type. Predefined and custom formats are ignored when a check box control is used. Therefore, these formats apply only to data that is displayed in a text box control.

Predefined Formats

The Format property provides the Yes/No, True/False, and On/Off predefined formats. Yes, True, and On are equivalent, as are No, False, and Off. If you specify one predefined format and then enter an equivalent value, the predefined format of equivalent value will be displayed. For example, if you enter True or On in a text box control with its Format property set to Yes/No, the value is automatically converted to Yes.

Custom Formats

The Yes/No data type can use custom formats containing up to three sections.

Section Description
First This section has no effect on the Yes/No data type. However, a semicolon (;) is required as a placeholder.
Second The text to display in place of Yes, True, or On values.
Third The text to display in place of No, False, or Off values.


'ope-that-'elps.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top