Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Have Yes/No checkbox on form; need radio button instead

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rachel Garrett - 28 May 2008 17:19 GMT
I have a field that is set to the Yes/No data type. It appears on the
form as a check box. I would prefer that it be a radio button. What is
the easiest way to create a Yes/No radio button and still have its
data be associated with that field?

Thanks,
Rachel G.
Marco - 28 May 2008 18:02 GMT
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

> I have a field that is set to the Yes/No data type. It appears on the
> form as a check box. I would prefer that it be a radio button. What is
[quoted text clipped - 3 lines]
> Thanks,
> Rachel G.
Rachel Garrett - 28 May 2008 19:17 GMT
> I'll try to help you but I dn't know if I can.
>
[quoted text clipped - 21 lines]
>
> - 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
Marco - 28 May 2008 19:50 GMT
HI.

in the toolbox toolbar there's a control qith that name Option Group.

You cannot create seperated radio buttons because they don't stay grouped
and work together.

then you can use the code that I sent with the select case.

the something like:

case1

id radio1.value = true then checkfield=Yes

Marco

> > I'll try to help you but I dn't know if I can.
> >
[quoted text clipped - 43 lines]
> Thanks,
> Rachel
BruceM - 28 May 2008 19:52 GMT
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

On May 28, 12:02 pm, Marco <Ma...@discussions.microsoft.com> wrote:
> I'll try to help you but I dn't know if I can.
>
[quoted text clipped - 22 lines]
>
> - 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
Rachel Garrett - 29 May 2008 20:33 GMT
Thanks, Bruce. This worked perfectly!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.