Blank Option (radio) Buttons in Option Group (1 Viewer)

RHubbard

Registered User.
Local time
Yesterday, 22:21
Joined
Dec 25, 2001
Messages
47
I am using an Access database for a foreign language dictionary project.

One of the forms I use is populated by a query (qryLemmaTable) to retrieve information from tblLEMMA.

This form works precisely as I intend it to work, but there is a glitch on it that is driving me mad.

The form in question has an option group with 11 radio buttons that correspond to the parts of speech associated with each word in tblLEMMA.

When I click on the button optAdjective I apply a filter and the only records that are displayed are adjectives. (The same applies for Nouns, Verbs, Prepositions etc.)

Here is the glitch: even though the radio buttons apply the filter correctly, no “black spot” appears in the button. Other signals on the screen let me know what word type is selected, so I can accomplish what I want, but I want the “black spots” too!

Perhaps this will be a clue: For each radio button I use the following code in the GotFocus event.
Me.FilterOn = False
Me.Filter = "wordtype = 'A'" ‘(or N, etc)
Me.FilterOn = True

And this for the Lost Focus event
Me.FilterOn = False

Thanks for the help.
 

RuralGuy

AWF VIP
Local time
Yesterday, 20:21
Joined
Jul 2, 2005
Messages
13,826
Use the AfterUpdate event of the OptionGroup instead and use a Select Case structure to decide what to do.
Code:
Private Sub optSuppliers_AfterUpdate()

Select Case optSuppliers
    Case 1
        '-- All Suppliers
        Me.cboSuppliers.Visible = False
    Case 2
        '-- Only One Supplier
        Me.cboSuppliers.Visible = True
    Case Else
End Select

End Sub
I just copied this code from one of my projects. Post back if you need additional assistance in the exact code for you to use.
 

RHubbard

Registered User.
Local time
Yesterday, 22:21
Joined
Dec 25, 2001
Messages
47
Thanks for the info- that looks like it makes more sense than what I was trying to do.

Since I posted my first question, another issue has arisen.

I placed an unbound combo box on my form so I can look up a specific word in the database. It works OK, but what I would like to do is have it display ONLY the words that are selected with the most current filter (applied with the buttons, discussed earlier). At the moment it selects from all of the several thousand words in the database instead of, for example, just "prepositions" if that filter is active.

I appreciate the advice!!
 

RuralGuy

AWF VIP
Local time
Yesterday, 20:21
Joined
Jul 2, 2005
Messages
13,826
Use the same Select Case code to replace the RowSource SQL in the ComboBox.
 

Users who are viewing this thread

Top Bottom