RE: Sorting filtered list on form with a Command Button
- From: LDMueller <LDMueller@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Feb 2008 04:17:01 -0800
Hi Maurice,
When I described my problem I tried to simplify it. Above each column in my
form I have sort buttons which toggle between ascending and descending so my
user can click a button above any column and resort it quickly. So putting
it in the query isn't an option.
Thanks!
"Maurice" wrote:
wouldn't it be easier to set the sort option in the query as well?.
--
Maurice Ausum
"LDMueller" wrote:
I have a form CLIENTLIST. When I open this form it runs the query
qryClientLst. One of the fields in the query named ClientID has the criteria
"Like [Enter Client Number]". When I open the form CLIENTLIST I'm prompted
to "Enter Client Number". When I do the form opens and only the files with
the client number I entered appear. So basically it's a filtered form. All
of this works fine.
I created a command button above the column ClientId on my form so my users
can click on the button and sort Ascending or Descending. Below is my code
for this. My only problem is when I click on the command button, I get the
prompted to [Enter Client Number] again.
If I remove the prompted from the query qryClientLst so it displays all
records when I open the form, everything works fine. But I need it to sort
the filtered list.
Private Sub cmdSort_Click()
If Right(Me.OrderBy, 4) = "Desc" Then
Me.OrderBy = "[ClientID]"
Else
Me.OrderBy = "[ClientID]" & " Desc"
End If
Me.OrderByOn = True
End Sub
Can anyone help me?
Thanks,
LDMueller
- References:
- RE: Sorting filtered list on form with a Command Button
- From: Maurice
- RE: Sorting filtered list on form with a Command Button
- Prev by Date: RE: Sorting filtered list on form with a Command Button
- Next by Date: RE: Sorting filtered list on form with a Command Button
- Previous by thread: RE: Sorting filtered list on form with a Command Button
- Next by thread: RE: Sorting filtered list on form with a Command Button
- Index(es):
Relevant Pages
|