Unbound option group writing text values...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have an interesting and extremely annoying problem with my option group!

I have setup an option group with 3 options; “Option 1â€, “Option 2†and
“Option 3â€. These options are not bound to a field as the field must store
these options in pre-determined text format and not numerical (i.e. 1, 2 or
3). Instead I have hidden the bound field “Signoff†and set the options
depending on the value in this hidden field. I have done this through the
forms ‘On Current’ event:

Private Sub Form_Current()

If Me.SignOff.Value = "Option 1" Then
Me.OptionGroup = 1
ElseIf Me.SignOff.Value = "Option 2" Then
Me.OptionGroup = 2
ElseIf Me.SignOff.Value = "Option 3" Then
Me.OptionGroup = 3
Else
Me.SignOff.Value = ""
Me.OptionGroup = 0
End If

End Sub

In order to set the field to the option selected I have set the option
button ‘On Got Focus’ event:

Private Sub Option62_GotFocus()

Me.OptionGroup = 1
Me.SignOff.Value = "Option 1"

End Sub

This works fine, except when I actually set an option button. When I set the
first record’s option button to “Option 1â€, the second option button is
unaffected, however the third record’s option button, which was previously
blank, is now being set to “Option 3†!?!

Please help.

Thanks in advance,
Dave
 
hi Davie,

Davie said:
Private Sub Option62_GotFocus()
Me.OptionGroup = 1
Me.SignOff.Value = "Option 1"
End Sub

This works fine, except when I actually set an option button. When I set the
first record’s option button to “Option 1â€, the second option button is
unaffected, however the third record’s option button, which was previously
blank, is now being set to “Option 3†!?!

Wrong event, should be OnClick, cause GotFocus is also triggerd by
tabbing through your options.

--> stefan <--
 
hi Davie,

Davie said:
I am using Access 97 and the 'OnClick' event is not available for option
buttons. Any further suggestions?

KeyPress or KeyUp and MouseUp are available and should be a sufficent
replacement.

--> stefan <--
 
hi Davie,

i forgot: have you checked the option values of option 1 and 3. Are they
different?

--> stefan <--
 
Back
Top