Option group & combo box relationship

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
 
D

Dale Fye

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
 

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

Similar Threads

Filter button / Select statement / String part 4
list box on subform 1
OLE error message 1
Type mismatch error 3
query by month 2
Automation warnings 1
Converting hypertext to text 2
DLookup in a query 2

Top