ADO filter

  • Thread starter Thread starter gr
  • Start date Start date
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
 
if FolderNumber and RegisterNumber as fields of rstdata source, then try:
strCriteria = "[FolderNumber] = '01' AND [RegisterNumber] = 1"
 
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
 
Back
Top