Option Group After Update event behaving oddly

  • Thread starter Thread starter Wadester
  • Start date Start date
W

Wadester

Hi everyone, this is my first posted message, though I've been
benefiting from this newsgroup for a while.

Using A2K and DAO, I've got modal popup form that contains some
controls (a combobox and a textbox) that, against my will, will keep
triggering the After_Update event of the option group if I click on
them.

*************In the popup forms class module...
Private Sub fraOptionGroup_AfterUpdate()
With Me
If .fraOptionGroup = 1 Then
'Disable or hide controls associated with
'the second option
[Blah, blah code]
'Enable or unhide controls associated with
'the second option
[More code, blah, blah, blah]
ElseIf .fraOptionGroup = 2 Then
'If the user chooses to assign the component
'a new location, do this...
'Clear the black bar from the "lstDefaultLocation"
'list box
Call ClearBlackBars(.lstDefaultLocation)
'Disable or hide all controls associated with
'the first option
[Blah, blah]
'Enable or unhide controls associated
'with the second option
[more code]
Else
Debug.Assert .fraOptionGroup < 1 Or .fraOptionGroup > 2
End If
End With
End Sub


************In a standard module...
Public Sub ClearBlackBars(lst As ListBox)
'This compensates for the Access black bar
'bug in its list boxes by
'first selecting and then deselecting
'each listbox position

[A few lines of code in here]
[but I don't want to post it cuz it might have come from one of
the ADH's]
End Sub

I found that if I remove the function ClearBlackBars(lst As ListBox)
from the procedure I don't have any problems, meaning, when the user
clicks on either the "cmoCabinet" combo box or the text box I haven't
said much about, the cmoCabinet_Click() or txtMyTextBox_Click()
procedures respectively occur.
Otherwise these events don't even happen and instead we just skip
right into the fraOptionGroup_AfterUpdate() event. Very strange.
 
I figured it out. I was making it too complicated.
I didn't need a sub in this context because a simple
Me.lstDefaultLocation = Null
gives me what I need.
Dooh!
 
Back
Top