sort AND filter

Lanason

Registered User.
Local time
Today, 16:33
Joined
Sep 12, 2003
Messages
258
I have some very simple code on a button on a form to sorts my data by company name. But as some of my data is for friends, I want to be able to add a line in that looks at the "Category" field and only includes those that are a "business". Can I do this.....?? So some sort of filter.

Private Sub Command43_Click()
On Error GoTo Err_Command43_Click

Me.OrderBy = "CompanyName"
Me.OrderByOn = True

Exit_Command43_Click:
Exit Sub

Err_Command43_Click:
MsgBox Err.Description
Resume Exit_Command43_Click
End Sub
 
re sort and filter

You could create a query that selects all the info you need specifying the category = 'Business' and sorting on company name.

(if the info is to be displayed in a report remove the sort in the query,
base the report on the query and do the sorting in the report)
 
Yeah but, no but, yeah but.....

Yep - thort about using a query but it always seems a pain going backwards and forwards when maybe a one liner would do it.

It works a treat for the sequence (which could have been done in a query)....
 

Users who are viewing this thread

Back
Top Bottom