Yes/No Field

B

Bill Johnson

I've searched for an answer to this.

I have four fields on a form that require Yes/No answers. Originally I used
check boxes but the user wanted to force a response, or at the very least to
show a default "No" so that the responses wouldn't be overlooked.

I'm using the response to the four questions in a series of tests to prove
or disprove whether a property lease can be treated as an operating or
capital lease.

When I set the default to No, the value in the field is 0. If the User
types a No, the value in the field is "False" (although it appears on the
form as "No") If the user types "Yes" the value in the field becomes "True"

I can live with that, so I set the default to False - the value if not
modified by the user is still 0. So I set the default to "False" now it
appears on the form as "False"

I'm confused. I can't code to expect a 0 when the value may be 0 or False
or No... There must be a way to set up the Yes/No field on a form, provide
a default and know what values to expect.

Another thing, I do not have a table attached to this form. It's meant to
be used to make a determination only, no data needs to be saved. Not a
database at all, just a tiny stand alone tool.

Help please.

Thanks Bill
 
B

Bill Johnson

Okay. I can make that work. I think you're saying I should use four Option
groups, each with two check boxes, or radial buttons, one for yes one for no.

thanks!
 
P

Paul Shapiro

A checkbox can be set to have 3 states: Yes, No, Null. When the value is
Null the checkbox appearance is grey, but it might not jump out at a user.

In Access both No and False have the value 0. True and Yes have the
value -1. So your logic only has to use the 0 value.

I assume your form has an action button, or something like that? If you want
to require a value for the 4 checkboxes, open the form with the action
button disabled. Only enable it when all 4 checkboxes are no longer null.
Use code in the AfterUpdate event of each checkbox to call a common routine
which will enable/disable the action button. Call that same code in the
form's OnCurrent event.
 
M

Mike Painter

Bill said:
I've searched for an answer to this.

I have four fields on a form that require Yes/No answers. Originally
I used check boxes but the user wanted to force a response, or at the
very least to show a default "No" so that the responses wouldn't be
overlooked.

I'm using the response to the four questions in a series of tests to
prove or disprove whether a property lease can be treated as an
operating or capital lease.

When I set the default to No, the value in the field is 0. If the
User types a No, the value in the field is "False" (although it
appears on the form as "No") If the user types "Yes" the value in
the field becomes "True"

You can set the format of the field to be "yes/no", "True/false", and I
think "On/Off"

I'd still use a combo box or radio button as the appearance of the numbers
can confuse people.



If this is not a boolian field you can limit what is entered to "yes" or
"no", default to no and use a click or double click to toggle.
If Field = "No" then
Field = "Yes"
else
Field = "No"
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top