ServerFilter Not Working

  • Thread starter Thread starter JH Szymanski
  • Start date Start date
J

JH Szymanski

I have a subform in an .ADP project that is based on a SQL
Server view. I have a button on the form that I use to
control filtering of the records displayed in the
subform. I was getting inconsistent results using
the .Filter property, so I changed the code to
use .ServerFilter. The filtering works better; however, I
must run the code twice in order for the
specified .ServerFilter to take affect. I've tried
using .Requery, .Refresh, .Recalc, .Repaint all of which
seem to make no difference. Are there any other tricks to
force the forms recordset to be filtered properly the
first time? Any ideas would be appreciated.

Thanks, JOE...
 
Try to reset the orderby before using the serverfilter

something like this :


Dim Vorder, strFilter as string

strFilter = .....

Vorder = me.orderby
me.orderby = ""
me.orderbyon = false

me.serverfilter = strFilter
me.requery

me.orderby = Vorder
me.orderbyon = true
 
Back
Top