Filter using a Macro that runs a Query

C

Chris DP

I am using Access 2007. In a previous version I created a simple query that
enabled a search on Company Name; Like "*" &[Enter Company Name] & "*", which
was written under criteria for Compnay Name in a query window. I then created
a button on a Form that ran this query via a macro. If pressed I could search
for a specific Compnay Name and if pressed again it would find another one.
However,in Access 2007 when I do press the button a second time it finds the
same company name ie runs the filter with the original company name. I have
tried Remove Filters, in a number of ways, but this still dosnt sort it out.
Does anyone know how I can do this is a similar simple way.
 
C

Chris DP

Currently I have found a way around this, which is to add a line at the start
of the macro which closes the Form. This has the effect of resetting the
filter! The Form is automatically reopened, due to the query, and asks for
the Company Name to be entered. It doesnt, therefore, revert to the previuos
data entered. Although this works it is surely not the best way to do it. In
Access 2003 there was no such problem. Can anyone advise me why there is a
difference on something so basic and what would be the better way to deal
with it.
 

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

Top