Using Option Button to Select Table Value

  • Thread starter Thread starter Allan
  • Start date Start date
A

Allan

I was wondering about the use of Option Buttons for use
in selecting a single value from a table.

For example:

I have a table with a list of months. I want one, and
ONLY one, month to be the "current active month". Within
the "Months" table I established a field "Active" (as
a "Yes/No" data type). I then linked the "Active" field
to an option button on a form. The buttons do not work in
a manner that I would expect. It allows the user to
select each month, rather than limiting the selection to
a single month. Is there something that can be changed in
the properties settings or should a routine be written to
accomplish this?

Allan
 
You can use checkbox instead option button.........
and in the checkbox click events,use VBA to set all recored fileld "Active"
as No except current record.......
Aaron _~@
Yang _`\<,_
? (*)/&(*)
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
 
in order for the buttons to work as you describe, they have to be part of an
Option Group control. if you just added Option Button controls to your form
and surrounded them with a border (or not), they are separate and
independent controls that will not work together unless you do a lot of
coding to make them.
but an Option Group control will accomplish what you want very easily, and
you don't have to code a thing. the easiest way to create it is to use the
Control Wizard: click that button on the Toolbox toolbar in form design
view (depressed means it's on). then click the Option Group button on the
same toolbar, and click on your form. the wizard will open and guide you
thru the process very well.

hth
 
Back
Top