ApplyFilter Sort problem!!

B

bronen

I have a command button that does the following:

DoCmd.ApplyFilter , "[Client_Internal] = [Client or SRA] AND [Status] =
'Open'"

What I want it to also do is group/sort a field called "Group Name".

What am i missing?

Thanks

Ben
 
V

Van T. Dinh

I assume the command button is on the Form you want to filter / sort:

Change your code to:

========
With Me
.Filter = "([Client_Internal] = [Client or SRA]) AND ([Status] =
'Open')"
.FilterOn = True
.OrderBy = "[Group Name]"
.OrderByOn = True
End With
========
 
V

Van T. Dinh

Is [Client or SRA] a "Parameter" you have to enter when the code is executed
or is it a value that already exists somewhere on the Form?
 
V

Van T. Dinh

I normally create a unbound TextBox, get the user to fill in the value
required before activating the filter (using the value in the TextBox as the
Parameter values) rather then the Filter getting the value. Some Form
processes in Access seem to run more than once and the value in the TextBox
will be available if the process is repeated.
 
Top