Option Button will not hold selection???

J

JK

I have an option group with four option buttons for "Titles," (Mr., Mrs.,
Ms., Dr.,)... I have code in the after update event of the option group to
populate a combo box with the selection from the option group. If I click Mr.
in the option group, Mr. appears in the combo box BUT, the option button next
to Mr.: does not remain selected. All of the option buttons are un-selected
whether I click one or not.

I cannot for the life of me figure out why this is happening!!! Pls Hlp!!!
 
J

John W. Vinson

I have an option group with four option buttons for "Titles," (Mr., Mrs.,
Ms., Dr.,)... I have code in the after update event of the option group to
populate a combo box with the selection from the option group. If I click Mr.
in the option group, Mr. appears in the combo box BUT, the option button next
to Mr.: does not remain selected. All of the option buttons are un-selected
whether I click one or not.

I cannot for the life of me figure out why this is happening!!! Pls Hlp!!!

This seems peculiar. What's the Control Source of the option group (I presume
nothing, i.e. it's unbound)? If it IS unbound, why would you EXPECT it to hold
its value - there is no value to hold!

I'd just use the combo box, and train the users about autocomplete.
<Tab><M><S><Tab> is almost surely quicker than moving the mouse and selecting
the Ms. option group button.

John W. Vinson [MVP]
 
J

JK

It appears there have been changes to this forum and how it acts when you
post a question - it seems I posted this question twice - for that I
aplologize...

Regarding the option group -

I have an option group with the Mr. Ms. etc. and I have a combo box with
that holds the value (Mr. Ms. etc.) and is bound to a table. You're right,
the option group is not bound but the combo box is.

I use this to update the combo box when a selection is made:
Private Sub optTitle_AfterUpdate()
Select Case Me.optTitle
Case 1
Me.Title = "Mr."
Case 2
Me.Title = "Mrs."
Case 3
Me.Title = "Ms."
Case 4
Me.Title = "Dr."
End Select
' Fix focus bug
Me.Title.SetFocus
End Sub


And I use this to update the Option Group from the bound combo:
Private Sub Title_AfterUpdate()
' Keep the title and the option group in sync
Me.optTitle = Null
Select Case Me.Title
Case "Mr."
Me.optTitle = 1
Case "Mrs."
Me.optTitle = 2
Case "Ms."
Me.optTitle = 3
Case "Dr."
Me.optTitle = 4
End Select
End Sub


This is from the Law Tracks example.
I cannot get the Option Group to match what's in the combo box.

Also note, the combo box is linked to a query, here is SQL:
SELECT Null As Title
FROM tblDummy
UNION ALL SELECT tlkpTitles.Title
FROM tlkpTitles
ORDER BY Title;

For the LIFE of my - can't make this work... I'm going insane!!!

Thx for your help...

Jason
 

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