Combo Box Help.

eckert1961

Registered User.
Local time
Yesterday, 18:52
Joined
Oct 25, 2004
Messages
90
Hello,

I have a main form that contains a combo box named ViewActive that lets me selective Active=Yes, No or when I double-click it all records are displayed.

When I select Yes then I only see active students when I use the record navigation to scroll through the records.

On the same form I have another Combo Box that displays the students names. If I select the pull down list all names are displayed whether or not I've selected the Active=Yes. The following is the AfterUpdate Code that I have linked to the Members combo box.

Private Sub cboMembers_AfterUpdate()
Dim rst As Recordset
Const QUOTE = """"

Set rst = Me.RecordsetClone
rst.Sort = ("[LastName]")
rst.FindFirst "([FirstName]& "" "" & [LastName] )= " & QUOTE & Me!cboMembers & QUOTE
If rst.NoMatch Then
MsgBox "No match was found. Student not in database!"
Else
Me.Bookmark = rst.Bookmark
End If
rst.Close
End Sub


Can someone note what needs to be changed so that only the names of the Active or Inactive members are displayed in this combo box depending on what is selected from the ViewActive combo box?

Thanks,
Chris
 
I would say the query behind your COMBOBOX has to detect the same filter criteria as the form, and you would have to requery your combobox when you change the form filter. Just as a guess
 
Solution

Thanks FoFa,

All I had to do is add the following to the AfterUpdate event of the ViewActive combo box.

cboMembers.Requery

Take care,
Chris
 

Users who are viewing this thread

Back
Top Bottom