If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
recordsetclone filter
Hi everyone,
I am having a strange problem with trying pass a filter to a recordsetclone Here is my code:::: Dim invDetailRS As ADODB.Recordset Dim rsClone As Recordset Set rsClone = frm.RecordsetClone rsClone.Filter = "TO_INVOICE = -1 " it seems to ignore any filter I pass to it. Anybody tried this before? Thanks,David |
#2
|
|||
|
|||
By definition, the form's RecordsetClone set is just a copy of the records
in the form, why not apply the filter directly to the form: frm.Filter = "TO_INVOICE = -1" frm.FilterOn = True Depending on the data source for the form, you may also find that the form's RecordsetClone is actually a DAO recordset, in which case assigning it to an ADO recordset is not likely to work. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "dp" wrote in message ... Hi everyone, I am having a strange problem with trying pass a filter to a recordsetclone Here is my code:::: Dim invDetailRS As ADODB.Recordset Dim rsClone As Recordset Set rsClone = frm.RecordsetClone rsClone.Filter = "TO_INVOICE = -1 " it seems to ignore any filter I pass to it. Anybody tried this before? Thanks,David |
#3
|
|||
|
|||
Thanks for your reply, that worked perfectly.
I still don't really have a good reference to what objects are ADODB and what are DAO. Is there a good reference out there? Thanks, David "Allen Browne" wrote: By definition, the form's RecordsetClone set is just a copy of the records in the form, why not apply the filter directly to the form: frm.Filter = "TO_INVOICE = -1" frm.FilterOn = True Depending on the data source for the form, you may also find that the form's RecordsetClone is actually a DAO recordset, in which case assigning it to an ADO recordset is not likely to work. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "dp" wrote in message ... Hi everyone, I am having a strange problem with trying pass a filter to a recordsetclone Here is my code:::: Dim invDetailRS As ADODB.Recordset Dim rsClone As Recordset Set rsClone = frm.RecordsetClone rsClone.Filter = "TO_INVOICE = -1 " it seems to ignore any filter I pass to it. Anybody tried this before? Thanks,David |
#4
|
|||
|
|||
DAO (Data Access Objects) is the native library, designed for MS Access.
When you create tables in Access, it uses DAO to create them. When you create tables in Access, it uses DAO. When you open a form into an Access table, is uses a DAO recordset. When you write code that opens recordsets using Access tables, it makes sense to use DAO. If you use other data sources such as SQL Server, or Internet based connections where you need disconnected recordsets, you might consider ADO. This article provides an overview of the objects in the DAO tree, and how to use them: http://members.iinet.net.au/~allenbrowne/ser-04.html -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "dp" wrote in message ... Thanks for your reply, that worked perfectly. I still don't really have a good reference to what objects are ADODB and what are DAO. Is there a good reference out there? Thanks, David "Allen Browne" wrote: By definition, the form's RecordsetClone set is just a copy of the records in the form, why not apply the filter directly to the form: frm.Filter = "TO_INVOICE = -1" frm.FilterOn = True Depending on the data source for the form, you may also find that the form's RecordsetClone is actually a DAO recordset, in which case assigning it to an ADO recordset is not likely to work. "dp" wrote in message ... Hi everyone, I am having a strange problem with trying pass a filter to a recordsetclone Here is my code:::: Dim invDetailRS As ADODB.Recordset Dim rsClone As Recordset Set rsClone = frm.RecordsetClone rsClone.Filter = "TO_INVOICE = -1 " it seems to ignore any filter I pass to it. Anybody tried this before? Thanks,David |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filter - Advanced Filter? | carrera | New Users | 4 | August 13th, 2004 09:33 PM |
Bug: print preview in form datasheet with server filter on crashes access (ADP A2002 SP3) | Eric Cárdenas [MSFT] | Using Forms | 4 | June 24th, 2004 08:38 AM |
Filter Button | Antonio | General Discussion | 4 | June 16th, 2004 05:21 AM |
Determining whther the user is setting or removing the filter... | Brad Pears | Setting Up & Running Reports | 1 | June 9th, 2004 04:29 PM |
Please help! Displaying only rows with empty cells in a numeric field using Advanced Filter. Thanks | JOCA | New Users | 1 | June 5th, 2004 02:37 AM |