Error in Access 2000, but not in 2002 or 2003

  • Thread starter Thread starter Anders
  • Start date Start date
A

Anders

I developed a database in Access 2000 -- but ran into
problems when I put a filter on a control in a form. (The
form was used as a subform to another form.)

A friend helped me fix the problem, by changing the
syntax of the SQL query. However, he works in Access
2003 -- and the correction he put in place does not work
when I use it with Access 2000. I still get the same
error. (I have also tried the corrected database in
Access 2002 and it worked fine there.)

Any advice would be most welcome. The actual error is
described in detail below.

Thanks,
Anders

-----
More detail on the actual error:
-----

A form was put as a subform in another form. Among other
controls, the subform had two controls, named "Phase"
and "Activities." The Activities-control had a filter put
on it -- depending on which of four alternatives that was
chosen in the Phase-control, the Activities-control would
requery itself and fill with the Activities corresponding
to the chosen Phase.

The filter worked fine when the form was used by itself.
When put as a subform, though, it did not. The error
message that came up read: "You can't use the ApplyFilter
on this window."

A friend corrected the SQL syntax used for the filter. It
used to be :

SELECT [ERCActivity].[ActivityName], [ERCActivity].
[ERCPhasesID]
FROM ERCActivity
WHERE ((([ERCActivity].[ERCPhasesID])=[Forms]![ProjectLog
subform1]![Phase]))
ORDER BY [ERCActivity].[DisplayOrder];

but he changed the WHERE statement to

WHERE (((ERCActivity.ERCPhasesID)=[Forms]![Project]!
[ProjectLog subform1].[Form].[Controls]![Phase]))

The change fixed the problem -- on his computer using
Access 2003! It worked when I tried it using Access 2002.
However, in the Access 2000 environment where the
database is supposed to be used, it does not work. The
error persists. What to do?
 
Hi

try this
WHERE (((ERCActivity.ERCPhasesID)=[Forms]![Project]!
[ProjectLog subform1]![Phase]))

What kind of error ?
There is nothing wrong with syntax here
WHERE (((ERCActivity.ERCPhasesID)=[Forms]![Project]!
[ProjectLog subform1].[Form].[Controls]![Phase]))

Check Project form if subform name is ProjectLog subform1 and
control name in ProjectLog subform1 is Phase

Aleksander


Anders said:
I developed a database in Access 2000 -- but ran into
problems when I put a filter on a control in a form. (The
form was used as a subform to another form.)

A friend helped me fix the problem, by changing the
syntax of the SQL query. However, he works in Access
2003 -- and the correction he put in place does not work
when I use it with Access 2000. I still get the same
error. (I have also tried the corrected database in
Access 2002 and it worked fine there.)

Any advice would be most welcome. The actual error is
described in detail below.

Thanks,
Anders

-----
More detail on the actual error:
-----

A form was put as a subform in another form. Among other
controls, the subform had two controls, named "Phase"
and "Activities." The Activities-control had a filter put
on it -- depending on which of four alternatives that was
chosen in the Phase-control, the Activities-control would
requery itself and fill with the Activities corresponding
to the chosen Phase.

The filter worked fine when the form was used by itself.
When put as a subform, though, it did not. The error
message that came up read: "You can't use the ApplyFilter
on this window."

A friend corrected the SQL syntax used for the filter. It
used to be :

SELECT [ERCActivity].[ActivityName], [ERCActivity].
[ERCPhasesID]
FROM ERCActivity
WHERE ((([ERCActivity].[ERCPhasesID])=[Forms]![ProjectLog
subform1]![Phase]))
ORDER BY [ERCActivity].[DisplayOrder];

but he changed the WHERE statement to

WHERE (((ERCActivity.ERCPhasesID)=[Forms]![Project]!
[ProjectLog subform1].[Form].[Controls]![Phase]))

The change fixed the problem -- on his computer using
Access 2003! It worked when I tried it using Access 2002.
However, in the Access 2000 environment where the
database is supposed to be used, it does not work. The
error persists. What to do?
 
Back
Top