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!

Checkbox for y/n/NA --1st q on tek-tips! 5

Status
Not open for further replies.

matthewhood

Technical User
Oct 15, 2001
7
US
What is the standard method for y/n/NA questions on a db form?

I am setting up a questionaire db. Most of the questions are simply yes/no, but some are yes/no/NA. For the latter, I would like to use a checkbox where NA = greyed in. How might I do this? What props would i need to change for the associated fieldname in the table?
-newbie on Access2002
 
Look in help for the following:

TripleState Property

Hope that helps... Terry M. Hoey
 
Oh, BTW, Welcome to TT... Terry M. Hoey
 
I have been having a bit of trouble with triplestate. Here's what i've done:
1. Set the triplestate property for the particular checkbox control to "yes"
2. Made a macro that used "setvalue" for this particular triplestate property, using the expression "Null"

Now my checkbox, when clicked, stays clear and doesn't revolve through the checked/grayed/cleared.

thnx for the welcome,
matthewhood
 
dear matthewhood,

did you set the triplestate property to null or the checkbox.value property (which it should be)?

regards astrid
 
dear astrid,

where my form = “blood” and my checkbox = “BldDate”
I had for my macro:
Action: setvalue
Item: [forms]![blood]![BldDate].[triplestate]
Expression: null

But I have now tried:
Item: [forms]![blood]![BldDate].[value]

…with the same results, i.e. I try to check the box and it remains clear.

Cheers,
matthewhood, (who is still searching for kata ton logos)
 
dear matthewhood,

try this:

in your macro
action:setvalue
item:[forms]![blood]![BldDate].[triplestate]
Expression:true

that should do
if you set it to false you have a Y/N checkbox

triplestate is itself a y/n (boolean) expression so you can set it to true or false

to set the values of the checkbox, it would be:

check it
action:setvalue
item:[forms]![blood]![BldDate].[value]
Expression:true

un check it
Expression:false

grey it out
Expression:NULL

hth
regards Astrid
 
dear astrid,

I'm still getting the same result with the triplestate set to true and/or the checkbox.value set to null.

cheers,
matthewhood, who is beginning to think his computer doesn't like him :-(
 
Ok, so my datatype is yes/no(I think i've been reading too much alternative logic literature). I had hoped that the nice little wizards that build forms from tables would help me in creating yes/no/NA option buttons, but i'm assuming they wouldn't insofar as they only create option buttons or checkboxes for yes/no data types. So two questions:
1. am i right in this assumption? i.e. do i have to laboriously create my own option buttons ;-)
2. what data type should i use? a. "yes" "no" "NA" qua text b. "1" "2" "3" qua byte sized number or c. something else : for the sake of both speed and ease of use.

well, ok, for the sake of philosophical speculation: 3. why don't we have a yes/no/null datatype? perhaps a 0/1/"" (or ;;) sort of situation? or do we, such that i am wrong in this post from the beginning?

and to piss Hegel and Aristotle off... 4. what of some fourth option, some contentless negation? some neither A nor not A? and could this ever be useful?

another user disillusioned by microsoft and the analytic tradition,
matthewhood
 
OK, I saw the long list of problems you were having and I tried to duplicate them. Here is what I found:
1) I created a table with a field [tt]YesNoNA[/tt] of type [tt]Yes/No[/tt]
2) I created a form with a check box for that field.
3) I clicked on it several times, turning it on and off.
4) I changed the TripleState property for that control on the form to Yes.
5) I returned to form view and clicked on the field. It never changed from clear.
6) I changed the control to an option button, same result.
6) I changed the field type in the table to [tt]Number[/tt]
7) I returned to the form and clicked. The form rotated through clear/grey/checked.
8) The values of the number are:
Clear: 0
Grey: NULL
Checked: -1

Does that help?
Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
:-D woo woo! thnx mucho Jonathan, it works adandily.

one more q,
how can you get a DAP control to do this?

- ahappy matthewhood
 
DAP control? Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
adandily??!??

John

Use what you have,
Learn what you can,
Create what you need.
 
DAP = Data Access Page
adandily = a'+ dandyishly - ish (i don't like the "ish")(definition #2)


Webster on dandy:
Main Entry: 1dan·dy
Pronunciation: 'dan-dE
Function: noun
Inflected Form(s): plural dandies
Etymology: probably short for jack-a-dandy, from 1jack + a (of) + dandy (origin unknown)
Date: circa 1780
1 : a man who gives exaggerated attention to personal appearance
2 : something excellent in its class
- dan·dy·ish /-dE-ish/ adjective
- dan·dy·ish·ly adverb

cheers,
matthewhood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top