Hello, I have a few questions regarding Access 2003.
1) What is the best way to record (in a table) a yes/no response? E.g. if someone arrived to an appointment or not - Yes they arrived, or no they didnt. Should it be a combobox value list of "yes" and "no"?
2) What is the best way to enable a query count the total of "Yes" and the total of "No" from that table? E.g. Yes=45, No=35.
3) How can I display the total of "yes" and the total of "no" each in a textbox on a form? I have tried the following Dcount
1. You store the value as a boolean (yes/no) into the table. The way you present it in a form (option buttons or radio buttons in an option group, textbox, combo, etc does not matter as far as the storage of the value is concerned.
2. SELECT COUNT(<Column>) FROM <Table or Query> WHERE <Column> = True (or = False)
3. It should be "[arrived] = True" and "[arrived ] = False" or "[arrived] = -1" and "[arrived ] = 0" or even "[arrived] <> 0" and "[arrived ] = 0"
You can create two queries: one that returns arrived when arrived = True and the second that returns arrived when arrived = false, and then combine both queries in a third performing the Count operations. In SQL you can do that in one step with subqueries: SELECT ... FROM ( SELECT ... ), but Access is a bit limited with that syntax.