-
Set a filter in a databound table
I have created a simple form containing a SSTab of two pages. This is bound
to a FoxPro 6.0 table with the following properties set on the data control:
Connect: FoxPro 3.0
Default cursor type: 1 – ODBC Cursor
Recordset type: 0 – Table
Recordsource: ltrser
The table in use contains records of two types of entries, memos and letters.
The field “type” contains either “M” or “L”. What I want to do is set a filter
to view one or the other type depending upon the page selected on the SSTab,
(Memos on one page; letters on the other). In FoxPro this is accomplished
with a one-line entry in the ‘click’ event, ‘Set filter to type = “M”’.
What is the syntax for setting this filter in Visual Basic?
Jim Donnelly
-
Re: Set a filter in a databound table
The direct answer to your question is to use the Filter property of an ADO
recordset.
recordset.Filter = "type = 'M'"
However, you may be better off with 2 recordsets, one with all "M" and one
with all "L". That would eliminate the potential problems you would have
with positioning on records in the recordset when you filter back and forth.
Dennis
"Jim Donnelly" <DonnellyJ@vab.alliedtech.com> wrote:
>
>
>
>I have created a simple form containing a SSTab of two pages. This is bound
>to a FoxPro 6.0 table with the following properties set on the data control:
>
>Connect: FoxPro 3.0
>Default cursor type: 1 – ODBC Cursor
>Recordset type: 0 – Table
>Recordsource: ltrser
>
>The table in use contains records of two types of entries, memos and letters.
>The field “type” contains either “M” or “L”. What I want to do is set a
filter
>to view one or the other type depending upon the page selected on the SSTab,
>(Memos on one page; letters on the other). In FoxPro this is accomplished
>with a one-line entry in the ‘click’ event, ‘Set filter to type = “M”’.
>What is the syntax for setting this filter in Visual Basic?
>
>Jim Donnelly
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks