Option Group

  • Thread starter Thread starter Maggie
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top