Using Drop down to search form

CanWest

Registered User.
Local time
Today, 11:17
Joined
Sep 15, 2006
Messages
272
I have a form that has a control to search the table for a specific record
See code below that is on the AfterUpdate event of a Combo Box

Code:
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[ClientID] = " & Str(Nz(Me![cboName], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    Me.cboTelephone = Null
    Me.cboName = Null

The source row of the combo box is

Code:
SELECT tblClients.ClientID, [LastName] & ", " & [FirstName] AS FullName
FROM tblClients
ORDER BY tblClients.LastName;

Note that the rowsource is from a table

I have several prebuilt filters that the user can use.

What I need to know is how to make the rowsource based on the filter and not the table. Any ideas would be greatly appreciated.
 
in yoru combo after update event put

me.filter="[ClientID] = " & Str(Nz(Me![cboName], 0))
me.filteron=true
 
That did not work.

It still lists ALL of the records not just the filtered ones


I placed this at the end of my existing code. Should it have been at a different spot.
 
it replaces your existing code - if you put it after, you have set cboname to null by then
 

Users who are viewing this thread

Back
Top Bottom