L
LDMueller
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
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