Option Buttons - 3 options

  • Thread starter Thread starter Newf via AccessMonster.com
  • Start date Start date
N

Newf via AccessMonster.com

I have 3 option buttons set up. I have the option values Canada (-1) United
States (0) and Other (?). I have tried using values 1, 2 ,3 & 0, 1, 2. None
of those slections let me select an option. Only when I use (-1) and (0).
Does anyone know what the problem is??

Newf
 
Newf said:
I have 3 option buttons set up. I have the option values Canada (-1)
United States (0) and Other (?). I have tried using values 1, 2 ,3 &
0, 1, 2. None of those slections let me select an option. Only when I
use (-1) and (0). Does anyone know what the problem is??

Newf

Do you want to store one of three values in a single field? (that would be the
correct way) Do you have the three option buttons inside an OptionGroup frame?
If not in an OptionGroup then an option button can only be True or False.
Inside an OptionGroup you can then assign each one a numeric value.
 
Every option button should have its own distinct value. I have never seen
(?) used as an option value.
What do you mean by "tried using values"?
 
Lol.. Sorry.. I should of clarified it. I have Canada (-1) US (0) Other (not
sure what to put in)

Newf

Duane said:
Every option button should have its own distinct value. I have never seen
(?) used as an option value.
What do you mean by "tried using values"?
I have 3 option buttons set up. I have the option values Canada (-1) United
States (0) and Other (?). I have tried using values 1, 2 ,3 & 0, 1, 2.
[quoted text clipped - 3 lines]
 
If it is indeed an Option Group and not just stand alone option buttons, the
value is returned from the option group, not the buttons. It returns the
Option Value of the currently selected option button.

Each button has an Option Value property. It must be a numeric integer. If
you are only allowed to use -1 and 0, I suspect you don't really have an
option group.

You can confuse your form if you try establishing the buttons first and try
to put a frame around them. I'm not saying it will not work, but if you do
it in this order, you will be assured it will work like you want.

Put a Frame control on your form.
Give it a Default Value.
Put option buttons inside the frame in the order you want them to be. That
is, if you want Canada to be 1, put the first button in the frame and make
the Caption Canada. It will automatically assign it an Option Value of 1.
If you want USA to be a value of 2, put the second button in the frame and
make the Caption USA, etc.

Then, in your code, to determine which button is currently selected, refer
to the OptionGroup, not the butttons.

If Me.opgCountry = 2 Then
.....

Newf via AccessMonster.com said:
Lol.. Sorry.. I should of clarified it. I have Canada (-1) US (0) Other (not
sure what to put in)

Newf

Duane said:
Every option button should have its own distinct value. I have never seen
(?) used as an option value.
What do you mean by "tried using values"?
I have 3 option buttons set up. I have the option values Canada (-1) United
States (0) and Other (?). I have tried using values 1, 2 ,3 & 0, 1, 2.
[quoted text clipped - 3 lines]
 
Back
Top