Command Button, ComboBox or something to Filter my Records on my Form.

M

michael.o'shea

I am trying to create a Command Button or ComboBox to Filter my
records/Cases.
Each record/ case is either: Open, Closed, Action Track.

Named (ComboCurrentStatus)
Control Source (CurrentStatus)

I want to be able to filter all my OPEN cases, CLOSED cases, Action
Track cases, and lastly be able to see all records on my form
(HOTLINE_INFO).

What is the easiest way to filter these records/cases. Thanks in
advance.
 
J

John Vinson

I am trying to create a Command Button or ComboBox to Filter my
records/Cases.
Each record/ case is either: Open, Closed, Action Track.

Named (ComboCurrentStatus)
Control Source (CurrentStatus)

I want to be able to filter all my OPEN cases, CLOSED cases, Action
Track cases, and lastly be able to see all records on my form
(HOTLINE_INFO).

What is the easiest way to filter these records/cases. Thanks in
advance.

I'd suggest using an unbound combo box with a Value List rowsource so
you can include ALL (you can use a Query if the list of status values
is likely to change in the future). The Value List would be

"All";"Open";"Closed";"Action Track"

(in whatever order you like of course).

In the combo's AfterUpdate event use code like

Private Sub cboFilterStatus_AfterUpdate()
If Me.cboFilterStatus = "All" Then
Me.FilterOn = False
Me.Filter = ""
Else
Me.Filter = Me.cboFilterStatus
Me.FilterOn = True
End If
End Sub



John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top