Tri-state condition box(es)

  • Thread starter Thread starter IanC
  • Start date Start date
I

IanC

I apologise if I'm not using the correct terminology here.

On a form I need to be able to allow the user to enter whether or not a
particular condition has been satisfied. On the face of it, as simple
"yes/no" would suffice, but I also need to ensure that the user has actually
made the selection.

What I need it a "yes/no/not stated" condition. I've done something similar
on an Excel spreadsheet, by having 2 cells, both of which are initially
empty. I suspect I could do something similar in Access with 2 yes/no tick
boxes, but I don't know how to link the boxes so that only one can be
occupied.

Any thoughts, bearing in mind that my strength lies in Excel and Excel VBA,
not Access?
 
Why noy use an option group. You can have as many options/conditions
as you need, but only one can be selected at a time.
 
In your table, create a field of type Number.

On your form, you can use a check box for this field, and set its Triple
State property to Yes.

However, there is no visible difference between False and Null in recent
versions of Access. You can get around this issue if you turn off Windows XP
Themes, or turn off the option for Themed controls in Access. But I think
you would be better advised to use a combo where it's obvious whether the
user chose yes or no or left it blank (not stated.)

If you want to go with the check box anyway, it is possible to
programmatically set the DisplayControl of the Number field so it
automatically uses a check box for the field when you add it to a form:
CurrentDb.TableDefs("Table1").Fields("Field1").Properties("DisplayControl")
= CInt(acCheckBox)

Screenshots and explanation as part of this article:
Why I stopped using Yes/No fields
at:
http://allenbrowne.com/NoYesNo.html
 
I've had a quick look at option groups and this looks like a suitable
solution. I've created a group with 3 check boxes. It all looks good, but
when I try to select any of the boxes, nothing happens. The check box
flickers when I click it, but it doesn't change state.

Any ideas?
 
Did you bind the option group to a Yes/No field in your table/query? If so,
that may be causing your problem. You should have a number field as the
control source of your option group.
 
Thanks Sean. That was exactly the problem. I've got that bit working now.
All I need to do now is figure out how I can stop a form being printed until
the default state has been changed by the user.

--
Ian
--
Beetle said:
Did you bind the option group to a Yes/No field in your table/query? If
so,
that may be causing your problem. You should have a number field as the
control source of your option group.
 

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

Back
Top