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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindFirst Method Problems

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I use the following code to open an external db and try to find a matching
record in a table in that db with one I declared (Variable1). The problem
is an error tells me Operation not supported by object when I get to the
FindFirst operation. Is there an alternative or is my syntax wrong?
Thanks

strTableName = "Tbl1"
strDBName = "C:\Program Files\DB.MDB"
Set dbImp = DBEngine.Workspaces(0).OpenDatabase strDBName, False, True, "")

Set rst = dbImp.OpenRecordset(strTableName)
rst.FindFirst "Field1 = '" & Variable1 & "'"

 
Access is probably opening the table as a table-type recordset, (I'm assuming it was a typo in the OpenDatabase line where the '(' was missing).

Try:
Set rst = dbImp.OpenRecordset(strTableName,dbopenDynaset)
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top