B
Bob Richardson
On my main form I want to change the Detail data that appears, based upon a
radio button (frame). There is a dropdown box (YearBox) where you can select
a school year (e.g. "2004-05"). With 3 of the buttons I want the data to be
taken from the Contacts table. This works fine. With the 4th button I want
to take the data from a query which potentially includes one record for each
year - then I want to limit the data so that it only shows records that
match the year in the drop down box. In the query, the "year" is held in the
SchYear field. Here's my feeble attempt. What am I missing?
Me.RecordSource = "Contacts"
Me.FilterOn = True
Select Case Frame31.Value
Case 0 ' All Contacts
Me.FilterOn = False
Case 1
Qry = "[Instructor] = Yes"
Case 2
Qry = "[TA] = Yes"
Case 3 ' Student
Me.RecordSource = "Q_StudentEachYear"
Qry = "[SchYear] = Me.YearBox"
End Select
Me.Filter = Qry
radio button (frame). There is a dropdown box (YearBox) where you can select
a school year (e.g. "2004-05"). With 3 of the buttons I want the data to be
taken from the Contacts table. This works fine. With the 4th button I want
to take the data from a query which potentially includes one record for each
year - then I want to limit the data so that it only shows records that
match the year in the drop down box. In the query, the "year" is held in the
SchYear field. Here's my feeble attempt. What am I missing?
Me.RecordSource = "Contacts"
Me.FilterOn = True
Select Case Frame31.Value
Case 0 ' All Contacts
Me.FilterOn = False
Case 1
Qry = "[Instructor] = Yes"
Case 2
Qry = "[TA] = Yes"
Case 3 ' Student
Me.RecordSource = "Q_StudentEachYear"
Qry = "[SchYear] = Me.YearBox"
End Select
Me.Filter = Qry