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

Data type question, Yes/No or Text

Status
Not open for further replies.

ron513

Technical User
Mar 9, 2004
31
US
Hello,

What would be the factors in determining whether to choose a field’s data type as either Yes/No or text?

In my situation, the field will be used on a form and have a combobox with a drop down, listing “Yes” and “No”. The user would select yes or no and it will be store in a table. The field will be used in queries.

Thanks for the help.

Ron
 
You're mixing apples and oranges. If the value to be stored in the table is logical (True/False;Yes/No) the data stored in the table is either a 0 or a 1. You can display this information or gather it on a form with a radio button group or a combo box or in a text field.



Leslie
 
Thanks for the quick response, Leslie.
Please bear with me.
So if the data type is Yes/No, on a form the user selects either yes or no from a combobox a 0 or 1 is stored? If the same field is viewed on a report would the stored value 0 or 1 be shown or the yes or no that the user selected from the combobox?

Ron
 
It all depend on what CONTROLS you put on the form or on the report.

And it is 0 and -1 Computers use 2's compliment maths remember

If you put a pair of radio buttons on the report then it appears to the uses as one or other of the buttons is pushed.

If you put a combo box with a row source of -1;"Yes;0;"No"
and colcount = 2
col widths = 0;
Then it will display 'Yes' or 'No'

If you just put a text box on the report it will show -1 or 0



This is not a data issue - it is a controls / GUI / presentation issue.



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
If you choose a logical data type (which you should if the information you are collecting is T/F or Yes/No) then the data stored in the table will be a 0 or -1.

If you tie the combobox to the field on a form you can have it display Yes/No. If you want to show it on a report then you can have it display Yes/No.

Leslie
 
if you want to display the value, use the IIF function :

IIF(myfield, "Yes", "No")
 
All,

Thanks for the information. I now have a better understanding of how I need to proceed.

Regards

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top