473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

built-in filter functions failing when form recordsource is set to recordset

Is it possible to use the built-in filter functions (ie. "Filter by
Selection", etc..) when a form's recordsource has been set to a
recordset object during the load event. When I try to do this, I
receive the message "Cannot apply filter on one or more fields
specified in the filter property".

here is the code for the recordset creation:

Set conn = New ADODB.Connection
Set rsSQL = New ADODB.Recordset
gstrSQL = "SELECT CheckList.* " & _
"FROM CheckList " & _
"ORDER BY CheckList.RunDate DESC ,
CheckList.LoanNumber;"
rsSQL.Open gstrSQL, conn, adOpenStatic, adLockReadOnly
Set Me.frmCheckList.Form.Recordset = rsSQL

It doesn't matter if the recordset is ADO (as in this example) or DAO.
For DAO recodsets, I receive a different error.
Nov 13 '05 #1
2 6654
You can't, sorry. :-(
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies
Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.

"Patrick Gonzalez" <pa**************@oomc.com> wrote in message
news:f3*************************@posting.google.co m...
Is it possible to use the built-in filter functions (ie. "Filter by
Selection", etc..) when a form's recordsource has been set to a
recordset object during the load event. When I try to do this, I
receive the message "Cannot apply filter on one or more fields
specified in the filter property".

here is the code for the recordset creation:

Set conn = New ADODB.Connection
Set rsSQL = New ADODB.Recordset
gstrSQL = "SELECT CheckList.* " & _
"FROM CheckList " & _
"ORDER BY CheckList.RunDate DESC ,
CheckList.LoanNumber;"
rsSQL.Open gstrSQL, conn, adOpenStatic, adLockReadOnly
Set Me.frmCheckList.Form.Recordset = rsSQL

It doesn't matter if the recordset is ADO (as in this example) or DAO.
For DAO recodsets, I receive a different error.

Nov 13 '05 #2
Actually, it works here just fine for disconnected recordsets based on
stored procedures (Access 2002 and 2003, ADO 2.7 and 2.8, SQL Server 2000
SP3a). I would make sure that the CursorLocation property of the recordset
is set to adUseClient and that its ActiveConnection property is set to
Nothing before binding the recordset to the form. Setting the UniqueTable
property of the form to any non zero-length string makes the underlying
disconnected recordset updatable, if that is needed.

The only issue I saw with this technique so far is that Access raised an
untrappable error "Data Provider could not be initialized" when removing
filter/sort via Access UI, but that can be worked around in the ApplyFilter
event, by cancelling the filter and re-binding the original unfiltered
recordset to the form.

On Jul 12 2004, 12:24 pm, "Michael \(michka\) Kaplan [MS]"
<mi*****@online.microsoft.com> wrote in news:40********@news.microsoft.com:
You can't, sorry. :-(

"Patrick Gonzalez" <pa**************@oomc.com> wrote in message
news:f3*************************@posting.google.co m...
Is it possible to use the built-in filter functions (ie. "Filter by
Selection", etc..) when a form's recordsource has been set to a
recordset object during the load event. When I try to do this, I
receive the message "Cannot apply filter on one or more fields
specified in the filter property".

here is the code for the recordset creation:

Set conn = New ADODB.Connection
Set rsSQL = New ADODB.Recordset
gstrSQL = "SELECT CheckList.* " & _
"FROM CheckList " & _
"ORDER BY CheckList.RunDate DESC ,
CheckList.LoanNumber;"
rsSQL.Open gstrSQL, conn, adOpenStatic, adLockReadOnly
Set Me.frmCheckList.Form.Recordset = rsSQL

It doesn't matter if the recordset is ADO (as in this example) or DAO.
For DAO recodsets, I receive a different error.


--
remove a 9 to reply by email
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JimmyT | last post by:
I just configured and installed 2.3.4 and noticed there is no datetime module. I noticed there is a datetimemodule.c file that did not get built (ie no object file). Is there something I need to...
1
by: Alex Elbert | last post by:
Hi I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML...
0
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
by: Mark | last post by:
Is there a way to execute a statement that is built dynamically by a .NET application. For example I have a loop that is reading values from a database and I want to do something like the...
4
by: Yasutaka Ito | last post by:
Hi, Is there a way to determine which version of .NET Framework any given assembly is built with? thanks! -Yasutaka
1
by: William | last post by:
Looking for a pre built dotnet corporate or small business website template.
1
by: William | last post by:
Looking for a pre built dot net website for consulting business. I am trying to put up a quick business web for a dot net frame work. I have a provider already. I am trying to save time. Any...
1
by: Daniel | last post by:
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built?
0
by: anthony Lichnewsky | last post by:
Hi, I have here a huge bunch of cygwin-built dlls using heavily posix api calls, and I wanted to know how to link them to some VC .NET library wrapper (using microsoft C runtime libraries this...
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.