ADO filter

G

gr

Hi, can someone tell me whats wrong on the next statement:

strCriteria = "rstData![FolderNumber] = " & "01" & " AND
rstData![RegisterNumber] = " & 1
rstData.Find strCriteria

After the rstData.Find strCriteria the next message is
displayed:
Arguments are or the wrong type, are out of acceptable
range, or are in conlfict with one other.

FolderNumber is a Text, and RegisterNumber is a Number.

Many thanks
 
A

Alex Dybenko

if FolderNumber and RegisterNumber as fields of rstdata source, then try:
strCriteria = "[FolderNumber] = '01' AND [RegisterNumber] = 1"
 
T

Tim Ferguson

strCriteria = "rstData![FolderNumber] = " & "01" & _
" AND rstData![RegisterNumber] = " & 1
rstData.Find strCriteria

According to the help file, the ADODB.Recordset.Find method has the
following restriction:

: Remarks
:
: Only a single-column name may be specified in criteria. This
: method does not support multi-column searches.


but I don't know if this is true or not as I very rarely find a need to use
ADO.

It also says this at the bottom of the page:

:
: Note An error will occur if a current row position is not
: set before calling Find. Any method that sets row position,
: such as MoveFirst, should be called before calling Find.
:

HTH


Tim F
 

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