Filtering a table-type recordset

How can I filter a table-type recordset? Setting the RecordSource property with an SQL statement doesn't seem to work.
mariosAsked:
Who is Participating?
 
pesaloneConnect With a Mentor Commented:
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
 
mariosAuthor Commented:
Where is my Table-type recordset?
0
 
pesaloneCommented:
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
All Courses

From novice to tech pro — start learning today.