Click to See Complete Forum and Search --> : Find First


urs
August 26th, 2001, 12:17 PM
Set db = DAO.Workspaces(0).OpenDatabase("rem.mdb", False, False, ";pwd=urs")
Set dt = db.OpenRecordset("Name")
this is how i am opening a database
i dont have data control or ado on my form
when i try to find with the coding
dt.FindNext ("Jhon")
i get an error message that "not supported by this object"
and when i use this coding
dt.FindNext = ("Jhon") or dt.FindNext = "Jhon"
i get an error message argument not optional
plzz help me

makai
August 27th, 2001, 12:40 AM
you need to open the database with a specific cursor type that supports findfirst - like snapshot I think - see help on the opendatabase function

gordonngai
August 30th, 2001, 04:46 AM
Hi

you want search the name = "Jhon"

Set db = DAO.Workspaces(0).OpenDatabas ("rem.mdb", False, False, ";pwd=urs")
' OpenRecordset (put the table name in)
Set dt = db.OpenRecordset("Name")

While Not dt.EOF And dt.Fields!Name <> "Jhon"
dt.MoveNext
Wend

dt!Name ' is "Jhon"


Gordon Ngai