Use the toolbox to add an option group (rectangle) to the form. Add two
radio buttons within the option group. Assign one radio buttons the Option
Value -1, and the other Option Value 0. This will correspond to the values
Access uses for Yes and No: -1 and 0. However, if you are planning to
store nulls (neither Yes nor No) you would do best not to use a Yes/No
field. Since you are using the option values -1 and 0 you should be able to
convert the Yes/No field to a number field. Bind the option group (not the
radio buttons) to this Number field.
You will be storing a number rather than the text, but you can convert it as
needed in a query or text box expression, or with VBA.
For another take on Yes/No fields, see:
http://allenbrowne.com/NoYesNo.html
I'll try to help you but I dn't know if I can.
I should create a group option.
then with some select case
case 1
if option1.value =true then txt="hello"
case2
if option2.value =true then txt="Goodbye"
end select
What do you think?
Marco
- Show quoted text -
Marco,
Thanks for the reply.
(1) What is creating a group option? I've already tried creating two
radio buttons and looking for ways to make them a group. I'm not
finding a way how.
(2) When I say these are in a form, I mean I have a form that was
created from an existing query. If I put your code into the SQL query,
that doesn't solve the problem of giving the user two radio buttons to
choose from. Only "txt" would be available for the form.
I would like to know what controls I have to add to the form, and what
VBA code I would have to add to the form, in order to allow the user
to select a radio button next to the word "Yes" and have the field
value be "Yes", or select a radio button next to the word "No" and
have the field value be "No."
Thanks,
Rachel