In vb i get error 3015 where it says idx(field name) isn't an index in this table. Look in the Indexes Collection of the Tabledef object to determine the valid index names.

I have Access97 database and checked that the field i mentioned is indexed(Autonumber).
I get error on the Redline given below.

Can anybody help on this please.

Private Sub Form_Load()

CenterForm Me


Set mobjCandRst = gobjhrDB.OpenRecordset("Candidate", dbOpenTable)
mobjCandRst.Index = "idxcandidpk"

mblnOKToExit = True


End Sub