Filtering forms (1 Viewer)

Tskutnik

Registered User.
Local time
Yesterday, 19:03
Joined
Sep 15, 2012
Messages
229
Simplest question ever and I can find the answer. I have a form [Accounts] which reads from a single table [Account.Data]. There are a few fields in the form and table, one of which is [Status].

I want a combo box at the top of the form that filters the [Status] field. The default value needs to be "Open", which will only show the records with [Status] = "Open". When the user selects a different value in the combo box, e.g. [Status] = "closed" , the form automatically filters to the record with those values.

So simple I'm sure.

Thanks
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 16:03
Joined
Aug 30, 2003
Messages
36,125
In the after update event of the combo try:

Me.Filter = "Status = '" & Me.ComboName & "'"
Me.FilterOn = True
 

llkhoutx

Registered User.
Local time
Yesterday, 18:03
Joined
Feb 26, 2001
Messages
4,018
Filter the form record source with the "status" combo box name. Note that the full form reference is required, not a Me reference, i.e. Forms!YourFormName!YourComboBoxName
 

Users who are viewing this thread

Top Bottom