Full Version: Option Group Not Selectable
UtterAccess Forums > Microsoft® Access > Access Forms
I have an option group with 2 radio buttons (planning on adding a 3rd when I figure this out). It has a default value.
It won't let me select the other radio button (though the interface recognizes the selection (dashed line around button), just doesn't activate the button).
Otried removing default and nothing shows. Anyone know what I may be doing wrong to elicit this error?
By the way, this is an unbound control on an unbound form.
The After Update event of the option group is supposed to change the textbox.value of a textbox to provide a different set of information to the user.
Has anyone had this experience with misbehaving option group on an unbound form?
Out of curiosity -- did you copy the first Option button to create the second -- and if so, did you remember to change the Option Value of the second option?
I hoped for a second there that I had done something like that. But alas, I indeed did that part correctly. Each control has a unique name, and they have different values: 1 and 2.
And other ideas?
I have completely avoided option groups until now, so I am not proficient in troubleshooting them.
I would suggest deleting the malfing option group in its entirety and putting a brand new one in its place.
I did as you said. Still no dice. Exactly the same problem.
Here is the code behind the form:
Option Compare Database
Option Explicit
Private Sub cmdLoadToad_Click()
'opens toad
Dim strToadPath As String
strToadPath = DLookup("strSettingValue", "tblSettings", "strSettingType = 'Toad Path'")
Shell (strToadPath)
End Sub
Private Sub Form_Load()
txtSqlString = DLookup("strSettingValue", "tblSettings", "strSettingType = 'SMF Extract SQL String'")
End Sub
Private Sub fraSource_AfterUpdate()
Select Case fraSource.Value 'this is the frame (option group)
    Case Is = 1
        'Me.txtSqlString.Value = DLookup("strSettingValue", "tblSettings", "strSettingType = 'SMF Extract SQL String'")
        'Forms!frmScreeningProgress.Form.txtStep2Complete.Value = "COMPLETE" 'set the value of the notice
        txtSqlString.Value = DLookup("strSettingValue", "tblSettings", "strSettingType = 'SMF Extract SQL String'")
    Case Is = 2
        txtSqlString.Value = DLookup("strSettingValue", "tblSettings", "strSettingType = 'SMF Payment Terms SQL String'") 'this is the control being updated
End Select
End Sub

Not sure why this code would be doing anything though... And it is compiling fine. Any other thoughts? I am all ears.
I'm wondering if it's your Select Case logic.
What if you leave off the reference to the .Value property?
Select Case fraSource 'this is the frame (option  group)

Instead of Case Is = 1 or Case Is = 2,
Try just Case 1 or Case 2
I tried as you said, but it didn't affect the outcome.
It looks like it is working when you go to design view, then go to form view.
It looks like it is not working when you get it loaded from the ribbon command (stored in VBA module).
But the sub in the ribbon calls it from a select case with the following code
DoCmd.OpenForm "frmSmfSqlText", acNormal, , , acFormReadOnly, acDialog

not sure why it would be a problem. The rest of the ribbon interface is running fine.
I have noticed this problem in the past (another project) with an unbound combobox doing this same thing (not selecting...or running the code on an afterupdate...whatever). Somehow I have not found people who have the same problems (or maybe I should use Bing instead of Google).
Looks like I just posted my problem!
The ribbon callback that ran the Docmd.OpenForm was setting the Form to acReadOnly! That explains why it worked fine with opening from design view.
Removing that fixed it. I can protect the form other ways.
Indeed. I need to remember the whole picture.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.