Recordset.Filter (2 Condition) is it Possible ?

  • Thread starter edisonl via AccessMonster.com
  • Start date
E

edisonl via AccessMonster.com

Hi,

I am currently using Access 2K, as such my form perform a search of one filed
using adodb.recordset.

My questions is: Is it possible to filter by 2 condition ?


Regards, Edison
 
E

edisonl via AccessMonster.com

Hi Bill,

Erm.. not sure how to do it let me try..
set rd...bla bla bla..
 
J

John W. Vinson

Hi,

I am currently using Access 2K, as such my form perform a search of one filed
using adodb.recordset.

My questions is: Is it possible to filter by 2 condition ?

Only one condition... but that can be as complex and multifaceted a condition
as you want. You can use AND logic, OR logic, subqueries, nested subqueries,
etc.

What is the structure of your table? What conditions do you want to apply?
 
E

edisonl via AccessMonster.com

Hi Vinson,

Tble is a standalone (No Relationship established) I like to filter out
Recordset with UserID as '1234' & Month = CurrentMonth

Summarize: If UserID took time off this month before append it unto current
month, else create new record under March.

Edison
 
J

John W. Vinson

Hi Vinson,

Tble is a standalone (No Relationship established) I like to filter out
Recordset with UserID as '1234' & Month = CurrentMonth

Summarize: If UserID took time off this month before append it unto current
month, else create new record under March.

This has essentially nothing to do with your original question, other than
that you're using two criteria!

An Update query is not an Append query, and an Append query is not an Update
query. I think you'll need two different queries - one to append, the other to
update.

Nobody here can see your tables, so we have no way to know how "month" is
entered (a date field? a text string "February"? something else?), nor how to
determine if UserID took time off. More details please, such as the names and
datatypes of your fields and perhaps a few records of example data!
 
S

Sylvain Lafontaine

No, you can't apply a multi-criteria filter on an ADO recordset. You can
with DAO but not with ADO.

Instead of applying a filter on a recordset opened over a full table, you
should learn how to make a query in order to retrieve only the relevant
records in the first place.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top