Form Filtering

G

Guest

I have a database with a form. It is currently sorted by a unique Transaction
ID, showing the oldest/lowest ID first and the newest/highest ID last. The
form has a button allowing you to apply custom filtering to it. It filters by
date range, category, and subcategory. It works fine, unless I change the
sort order. If I sort it in Descending order - with the newest transactions
first - the filter doesn't work. It looks like it is being applied, but I can
still see all of the records (on the bottom of the form, where it shows you
what record you are on out of x records).

Is there some type of limitation the filtering function has when your data
is sorted in a certain order?
 
G

Guest

Do you mean I'll have to redo the filtering code? The filter works if the
data is sorted ascending. If I remove the filter, sort it descending, and
then apply the filter again, it doesn't work. If I need to add sorting in the
code, how would I do that? Right now, I am creating a SQL string with the
specific validating requirements (date, etc.). Would I sort within that SQL
string?
 
G

Guest

After some experimenting, I was wrong about the need to requery.
I was able to set the filtering, then change the order without any problems.

Me.Orderby = "[Activity] DESC"
Me.OrderbyOn = True

Me.Filter = "[Program Manager] = 'Popeye'"
Me.FilterOn = True
 
G

Guest

Would this work if I'm using the ServerFilter and ServerFilterByForm filter
functions?

Klatuu said:
After some experimenting, I was wrong about the need to requery.
I was able to set the filtering, then change the order without any problems.

Me.Orderby = "[Activity] DESC"
Me.OrderbyOn = True

Me.Filter = "[Program Manager] = 'Popeye'"
Me.FilterOn = True

--
Dave Hargis, Microsoft Access MVP


GHawkins said:
Do you mean I'll have to redo the filtering code? The filter works if the
data is sorted ascending. If I remove the filter, sort it descending, and
then apply the filter again, it doesn't work. If I need to add sorting in the
code, how would I do that? Right now, I am creating a SQL string with the
specific validating requirements (date, etc.). Would I sort within that SQL
string?
 
G

Guest

Oh, you didn't say you are using and adp and ADO.
My experience in that area is limited. I suggest you repost your question
and specify the environment: Acccess version, format (mdb, adp), back end
type (mdb, SQLServer, Oracle,etc)

Sorry I could not really help.
--
Dave Hargis, Microsoft Access MVP


GHawkins said:
Would this work if I'm using the ServerFilter and ServerFilterByForm filter
functions?

Klatuu said:
After some experimenting, I was wrong about the need to requery.
I was able to set the filtering, then change the order without any problems.

Me.Orderby = "[Activity] DESC"
Me.OrderbyOn = True

Me.Filter = "[Program Manager] = 'Popeye'"
Me.FilterOn = True

--
Dave Hargis, Microsoft Access MVP


GHawkins said:
Do you mean I'll have to redo the filtering code? The filter works if the
data is sorted ascending. If I remove the filter, sort it descending, and
then apply the filter again, it doesn't work. If I need to add sorting in the
code, how would I do that? Right now, I am creating a SQL string with the
specific validating requirements (date, etc.). Would I sort within that SQL
string?

:

If you change the sort, you have to redo the filtering
--
Dave Hargis, Microsoft Access MVP


:

I have a database with a form. It is currently sorted by a unique Transaction
ID, showing the oldest/lowest ID first and the newest/highest ID last. The
form has a button allowing you to apply custom filtering to it. It filters by
date range, category, and subcategory. It works fine, unless I change the
sort order. If I sort it in Descending order - with the newest transactions
first - the filter doesn't work. It looks like it is being applied, but I can
still see all of the records (on the bottom of the form, where it shows you
what record you are on out of x records).

Is there some type of limitation the filtering function has when your data
is sorted in a certain order?
 
G

Guest

I'll repost it, thanks for the tip. The database I'm working with was created
by someone else, so I'm kind of blindly working on it. Thanks for your help!

Klatuu said:
Oh, you didn't say you are using and adp and ADO.
My experience in that area is limited. I suggest you repost your question
and specify the environment: Acccess version, format (mdb, adp), back end
type (mdb, SQLServer, Oracle,etc)

Sorry I could not really help.
--
Dave Hargis, Microsoft Access MVP


GHawkins said:
Would this work if I'm using the ServerFilter and ServerFilterByForm filter
functions?

Klatuu said:
After some experimenting, I was wrong about the need to requery.
I was able to set the filtering, then change the order without any problems.

Me.Orderby = "[Activity] DESC"
Me.OrderbyOn = True

Me.Filter = "[Program Manager] = 'Popeye'"
Me.FilterOn = True

--
Dave Hargis, Microsoft Access MVP


:

Do you mean I'll have to redo the filtering code? The filter works if the
data is sorted ascending. If I remove the filter, sort it descending, and
then apply the filter again, it doesn't work. If I need to add sorting in the
code, how would I do that? Right now, I am creating a SQL string with the
specific validating requirements (date, etc.). Would I sort within that SQL
string?

:

If you change the sort, you have to redo the filtering
--
Dave Hargis, Microsoft Access MVP


:

I have a database with a form. It is currently sorted by a unique Transaction
ID, showing the oldest/lowest ID first and the newest/highest ID last. The
form has a button allowing you to apply custom filtering to it. It filters by
date range, category, and subcategory. It works fine, unless I change the
sort order. If I sort it in Descending order - with the newest transactions
first - the filter doesn't work. It looks like it is being applied, but I can
still see all of the records (on the bottom of the form, where it shows you
what record you are on out of x records).

Is there some type of limitation the filtering function has when your data
is sorted in a certain order?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top