ApplyFilter problem

P

PayeDoc

Hello All

I have a form with a button with the following OnClick event:
DoCmd.ApplyFilter ("qry eoys to do")

The sql of "qry eoys to do" is:
SELECT practices.[prac name], practices.[20056 EOY], Left([prac name],1) AS
initial
FROM practices
WHERE (((practices.[20056 EOY])="6") AND ((Left([prac name],1))<"c"));

When I click the button to apply the filter I get a message that the field
[prac name] could refer to more than one table listed in the FROM clause of
the sql statement ... which I really don't get at all!!

Hope someone can help.
Many thanks
Leslie Isaacs
 
D

Dorian

Why do you sometimes qualify the columns and sometimes not? Maybe that is
confusing the query. Be consistent and don't qualify any or qualify them all.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
L

Leslie Isaacs

Hello Dorian

Many thanks for your reply.

I have to confess, though, that I don't understand what you mean! When you
say that I am qualifying some of the columns but not others, do you mean
that some have a criteria set and others have no criteria set?

Sorry to appear stupid!

Thanks for your continued help.
Les

Dorian said:
Why do you sometimes qualify the columns and sometimes not? Maybe that is
confusing the query. Be consistent and don't qualify any or qualify them
all.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and
they
eat for a lifetime".


PayeDoc said:
Hello All

I have a form with a button with the following OnClick event:
DoCmd.ApplyFilter ("qry eoys to do")

The sql of "qry eoys to do" is:
SELECT practices.[prac name], practices.[20056 EOY], Left([prac name],1)
AS
initial
FROM practices
WHERE (((practices.[20056 EOY])="6") AND ((Left([prac name],1))<"c"));

When I click the button to apply the filter I get a message that the
field
[prac name] could refer to more than one table listed in the FROM clause
of
the sql statement ... which I really don't get at all!!

Hope someone can help.
Many thanks
Leslie Isaacs


.
 

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

"Too few parameters" error - sometimes 1
Simply query? 9
Cannot open recordset 2
Slow query 1
Too few parameters? 11
Creating a function? 13
Function not known! 6
Initiate an action only if query returns data 2

Top