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

PrimaryKey as reference to key field?? like dao

Status
Not open for further replies.

kiwiCoder

Technical User
Aug 2, 2001
45
NZ
is it possible to use "Primary Key" as a reference to the field to be searched as in dao. IE
My ADO code
tTable.Open sTable, cnxnCroppak, adOpenDynamic, adLockOptimistic
tTable.Fields(0).Properties("OPtimize") = True
tTable.Find "[Primary Key] = " & lTableKey

Original DAO code
Set tTable = gdbCropPak.OpenRecordset(sTable, dbOpenTable)
tTable.Index = "PrimaryKey"

tTable.Seek "=", lTableKey
I have tried
tTable.Find "tTable.Fields(0).value = " & lTableKey
but that doesnt work either.
Any help appreciated
 
Wrong forum, but you might try tTable.find "PrimaryKeyFieldName = " & lTableKey
That would assume that the field is type int. If it were varchar, they you would have to place single quotes around lTableKey.
-Karl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top