Or, Openning the recordSet already filtered Instead of using FindFirst
Set MyRec = MyDB.OpenRecordSet("Select * From TableName Where FieldName = 2")
If Not MyRec.Eof Then
.......
End If

Signature
Good Luck
BS"D
> do you mean by opening a recordset using the sql, then performing the search?
>
> > > can I use a SQL statement for the domain in dlookup?
> >
> > No. A custom replacement that did though should not be too difficult to create.
Wavequation - 31 Oct 2007 17:04 GMT
Is that code using a dao database object?
> Or, Openning the recordSet already filtered Instead of using FindFirst
>
[quoted text clipped - 9 lines]
> > >
> > > No. A custom replacement that did though should not be too difficult to create.
Ofer Cohen - 31 Oct 2007 17:18 GMT
Need to declare the database and recordset
' Declaration
Dim MyDb as Dao.DataBase, MyRec as Dao.RecordSet
' Set to the current db
Set MyDb=CurrentDb()
' Open record set
Set MyRec = MyDB.OpenRecordSet("Select * From TableName Where FieldName = 2")
' check if any records returned
If Not MyRec.Eof Then

Signature
Good Luck
BS"D
> Is that code using a dao database object?
>
[quoted text clipped - 11 lines]
> > > >
> > > > No. A custom replacement that did though should not be too difficult to create.