Apply filter macro

  • Thread starter Thread starter Sandra
  • Start date Start date
S

Sandra

I have built an application using Access 2000. My customer
has an XP operating system and is using office 2000
software. I have a command button on a form which applies
a filter (in the form of a query) to the form. It works
fine on my computer (running Windows 2000) but not on the
XP computer, it just doesn't do anything.
Any suggestions would be welcome.
Many thanks
 
Sandra,
Could you provide the code you are using to do this? As long as the Access
versions are the same, I can't off the top of my head think of why they
would be behaving differently. The OS really shouldn't have much to do with
it for this kind of functionality.
 
Bryan,
Thanks for the response.
I have two separate database applications with similar
problems.
The first database has a form which opens in data entry
mode only. I have placed a command button on the form
which calls a macro called ViewAll which has the one
action: RunCommand RemoveFilterSort.
The second database contains a series of very similar
forms which ask the user to select several criteria using
combo boxes and then the relevant records are displayed by
clicking on a command button which has the attached code:
DoCmd.ApplyFilter "KH07RFilter" where KH07RFilter is the
name of a query. I have used this second database
application successfully for years but when I try to run
it on a machine installed with Windows XP and Office 2000
the command buttons which apply the filters do not seem to
work.
Any thoughts would be most appreciated.
Regards
Sandra Robinson
 
Sandra,
Let me suggest a few basics to make sure we have straight, then if we're
still stuck let me know and I'll continue digging.

First, make sure in your code that you also are setting the form's FilterOn
property to True to make sure the filter is actually being applied. Also, is
there a reason why we are using an entire query to set the filter and not
just setting the filter value to a where clause? The where clause approach
would be simpler I'm sure, but obviously I don't know your scenario.
Regarding the first database, perhaps we can try doing the same operation in
VBA code instead of with a macro (so Application.RunCommand
acCmdRemoveFilterSort)
At least that way we have a way to debug and try different things if
necessary, which unfortunately we don't have with macros.
Let me know how these various suggestions work out and we can go from there.
 
Hi Bryan,
I have set the forms FilterOn property to True in the
first database and changed the macro code as suggested and
it appears to be OK. I have never had to set the FilterOn
property before and I have been writing simple database
applications for years. Can you explain why I now have to
set this property? Is it to do with running under XP?

Many thanks for your help. I'm sure this won't be the last
time I use the discussion forum. It is very reassuring to
know that help is out there.

Regards
Sandra
 
Sandra,
I wish I had a good answer! :)
The OS you're running on really shouldn't matter for this kind of thing. If
it were the Office version, that might make some sense. Sometimes when
you're stumped the solution is just to try it a slightly different way and
hope you've changed the right thing! I'm glad we were able to get it working
again, but it is truly a baffling thing.
 
Back
Top