Filter a split form by a combo box

ECEK

Registered User.
Local time
Today, 22:43
Joined
Dec 19, 2012
Messages
717
I wish to filter my split form in vba afterupdate of a combo box.

Can anybody point me in the right direction please.

Basically I need the afterupdate vba code

AfterUpdate

filter my frmsplitform where me.combo1 = [Surname]

i can't find this anywhere !!

Thanks people
 
Assuming your combo is called Combo1 & the bound field is surname then

Code:
Private Sub Combo1_AfterUpdate()

    Me.Filter = "Surname = '" & Me.Combo1 & "'"
    Me.FilterOn = True
End Sub
 
Thanks Ridders I was having a blank moment

I also found
Code:
DoCmd.ApplyFilter , "[Surname]='" & Me.Combo1 & "'"
 
Why the need for combo when you can filter the datasheet.
 

Users who are viewing this thread

Back
Top Bottom