Solved

Filtering a table-type recordset

Posted on 1997-12-01
3
220 Views
Last Modified: 2008-03-06
How can I filter a table-type recordset? Setting the RecordSource property with an SQL statement doesn't seem to work.
0
Comment
Question by:marios
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
pesalone earned 50 total points
Comment Utility
Dim WS as Workspace
Dim DB as Databse
Dim Filtered as QueryDef
Dim MyQuery as String

Set WS = DBengine.Workspaces(0)
Set DB = WS.OpenDatabase("C:\TEMP.MDB")

Set Filtered = DB.CreateQueryDef("Filtered")

MyQuery = "SELECT * FROM <Your Table> WHERE <Your Field> >= <Some Value>"

Filtered.SQL = MyQuery


0
 

Author Comment

by:marios
Comment Utility
Where is my Table-type recordset?
0
 
LVL 1

Expert Comment

by:pesalone
Comment Utility
Hello!

I studied this problem and I think it is impossible!!
At least my VB Manuals didn't know anything about Creating Table type recordset with SQL Query.

Why don't you use a Query like I suggest? You can use it like Table type recordset. You can sort, filter or delete records as well as in table type.

BR    Petri Salonen
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now