I've created a option group with 4 options (optRed, optBlue, optYellow and optGreen). I have a variable named color. I'm
trying to write code that when a option button is selected (red, blue, yellow or green) the variable color is set to that
color. I have the option values set to 1,2,3 and 4 respectively from the form design. In the code I wrote:
If optRed.value = True then
color = "Red"
ElseIf optBlue.value = True then
color = "Blue"
ElseIf optYellow.value = True then
color = "Yellow"
ElseIf optGreen.value = True then
color = "Green"
The problem that I get is VBA won't allow me to set the value of optRed or anything other option buttons. It gives me the
error that says, "optRed.Value = <You entered an expression that has no value.
Can anyone show me how to do this in Access 97's VBA.