By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

Problem with 'Filter By Form'

P: n/a
Hello,
I have a problem with field filtering between an Access 2000 Project form
(the application is called CELDT), and the report that shows the results of
the filter. Both the form and the report are based on the same View
addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides
in a SQL Server 2000 database. There are two different problems I am having
with filtering: The first involves filtering in the form by date fields, the
other occurs when I try to open a report to show the results of filtering on
fields in the form where the SQL Server datatype is 'nvarchar', and the
criteria filtered in the form 'IS NULL'.

In the form, I can filter by any field except a field where the field data
source is 'smalldatetime'. When I attempt to preform any filter on such a
field, I get the following message: "Cannot apply Filter on one or more
fields specified in the Filter property". After clicking 'OK', the filter
does not occur, I am retunred back to the form, and the field I attempted to
set up the filter in has focus.

The other filtering problem occurs when I try to filter for 'IS NULL' in the
form with fields of the 'nvarchar' data type. When I attempt to filter this
way on such a field, the form does its filter and shows the filtered
records, but the problem occurs when I try to view a report that shows the
results of the filter.

The way I handle the filtered data in the report is like this: After the
filter takes place in the form, the user clicks a button that runs the
following macro:

*********************
OpenReport (rptMainFilteredSummary, Print Preview, no Filter Name, no Where
Condition)
.... SetValue (Item: [Reports]![rptMainFilteredSummary].[Filter])
(Expression: [Forms]![frmMain].[Filter])
.... Maximize
*********************
The value of the form Filter property that gets passed to the report Filter
property when filtering for 'IS NULL' in the form looks something like this:
((dbo.CLMain_vw.Status Is Null)). The 'Filter On' property in the report is
set to 'Yes'.

The Filter property syntax works fine for the Filter property in the form,
but when I try to use this same syntax directly in the Filter property of
the report, or when I click the button that runs the macro to open the
report and display the results of the filter, I get the following message
when the report tries to open:
"CELDT can't find the object 'CELDT can't find the object 'dbo.CLMain_vw.'.'
*You misspelled the object name. Check for missing underscores (_) or other
punctuation, and make sure you didnt' enter leading spaces.
*You tried to open a linked table, but the file containing the table isn't
on the path you specified. Use the Linked Table Manager to update the link
and point to the correct path."

Only this message shows up when the report opens (no data shows up in the
report), and when I click 'OK' on the message, the report closes, and I am
returned back to the form. This filter problem only occurs when my form
filter criteria for the 'nvarchar' fields is 'IS NULL'. It does not happen
when the criteria for these fields is actual data, or when the criteria is
expressed as 'IS NOT NULL'.

How can I overcome these problems?

Thanks for your help!

CSDunn
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.