Option Group

M

Maggie

Is it possible to have an option group that will save the
actual value that I select as opposed to assigning a
numerical value?

How do I set this up?

Thanks,

Maggie
 
S

Sandy

You need to do this with code.

Here is an example for a Gender Option Group. Leave the option group
unbound and update the value of the field with code as below.

Private sub OptionGroup_AfterUpdate
if me.OptionGroup = 1 then
Me.Gender = "Male"
elseif me.OptionGroup = 2 then
Me.Gender = "Female"
else
Me.Gender = "Unknown"
End if

Sandy
 
G

Guest

Okay these are probably pretty questions but how do I
unbound an option group. I use the wizard to create
them. It there something in the properties that I must
change. Also, where do I put the code?

Thanks,

Maggie
 
S

Sandy

In the form design view, right click on the Option group and select
Properties.

The second propery in the list is Control Source. Simply delete the value in
that property.

To add the code, scroll down in the properties and click on the three dots
next to the After Update property. This will take you to the code window
where you can write some code like the suggested.

Sandy
 

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

Top