Option group & combo box relationship

  • Thread starter Thread starter Kevin Bruce
  • Start date Start date
K

Kevin Bruce

I have a form that displays information pertaining to contracts that my
organization issues.

On the form there is a combo box that displays the year. When the user
changes the year, an AfterUpdate event occurs (Me.Requery) and the
information displayed on the form changes to the corresponding year. All
data displayed in the form is limited to the year selected in this combo
box.

There is also an option group consisting of three toggle buttons:
'Contracts Issued', 'Contracts Not Returned', and 'All Contracts'. When the
user selects a toggle button, a Select Case routine runs, and unwanted
records are filtered out.

The problem: When the year is changed in the combo box, the records on the
form do not requery until after the toggle buttons have been clicked. This
does not happen when the form is first opened, but only after the user has
used the toggle buttons at least once.

My assumption is that after the combo box displaying the year is updated, my
code should then set the focus to the option group and requery the form. My
code as written, however, does not accomplish this:


Private Sub cboYear_AfterUpdate()

fraContractFilter.SetFocus
fraContractFilter = 3
Me.FilterOn = False

Me.Requery

End Sub


Any assistance would be gratefully received.

--
================================
Kevin Bruce
Program Coordinator
ArtStarts in Schools
301 - 873 Beatty Street
Vancouver, BC V6B 2M6

ph:604-878-7144 ext.3
fx: 604-683-0501

web: www.artstarts.com
 
Kevin,

You're on the right track. I'm assuming that the query for the forms record
source includes a reference to your combo box, if that part of things is
working correctly. Try the following:

Private Sub cboYear_AfterUpdate()

me.requery
Call fraContractFilter_AfterUpdate

End Sub

Dale
 
Back
Top