Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find method from two criteria

Status
Not open for further replies.

miho1

Technical User
Oct 22, 2002
78
BG
I want to use method Find from two criteria

DataEnvironment1.rsCommand1.Find " Name = '" & Text1. Text & "' And Size > 0 "

But gives Error.

Whether it is possible to make it and what syntax?

I shall be very grateful.

Miho

 
Your FIND clause looks OK except that you have a space between "Text1." and "Text" ... could that be the problem? You might also put brackets around the field names.
Code:
   DataEnvironment1.rsCommand1.Find "[Name]='" & Text1.Text & "' And [Size]>0 "
 
And so does not work.
If to write

DataEnvironment1.rsCommand1. Find " Name = ' " and Text1. Text and "'"

Everything is all right, but when will add

And Size > 0

Gives Error
 
Run-time error '3001'

Arguments are of the wrong type,are out of acceptable range,or are in conflict with one another
 
As you are specifying them, "Name" must be a Text field and "Size" must be numeric ... are they? Since the problem doesn't occur until you add "Size", I'm assuming that it is the field that has the problem.
 
When I write

DataEnvironment1.rsCommand1. Find " Size > 0 "

There is no problem
 
There is no problem when apply two kriteria separately.
 
You cannot use multiple fields with the Find method.
You will need to use the Filter method, best when used with a recordset clone and then setting the bookmark of the original recordset to the bookmark of the cloned recordset.
 
And I have reached up to this conclusion and have made as you spoke.

It is very grateful.

Miho
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top