Hey,
I am getting an error message for an udate button I have programmed. The error reads
'Primary Key' isn't an index in this table. Look in the indexes collection of the TableDef object to determine the valid index names.
I have the primary key set on both tables but I am not sure why this is happening.
Any suggestions would be great!
Chris
Private Sub Command20_Click()
Dim rsupdate As Recordset
Dim dbmain As Database
Set dbmain = CurrentDb()
Set rsupdate = dbmain.OpenRecordset("tbltest")
Dim Jobno As String
txtJobNo.SetFocus
Jobno = txtJobNo.Text
'I get the error on the next line
rsupdate.Index = "Primary Key"
rsupdate.Seek "=", txtJobNo.Text
If rsupdate.NoMatch Then
MsgBox " Test"
End If
End Sub
________
ford n series tractors history
I am getting an error message for an udate button I have programmed. The error reads
'Primary Key' isn't an index in this table. Look in the indexes collection of the TableDef object to determine the valid index names.
I have the primary key set on both tables but I am not sure why this is happening.
Any suggestions would be great!
Chris
Private Sub Command20_Click()
Dim rsupdate As Recordset
Dim dbmain As Database
Set dbmain = CurrentDb()
Set rsupdate = dbmain.OpenRecordset("tbltest")
Dim Jobno As String
txtJobNo.SetFocus
Jobno = txtJobNo.Text
'I get the error on the next line
rsupdate.Index = "Primary Key"
rsupdate.Seek "=", txtJobNo.Text
If rsupdate.NoMatch Then
MsgBox " Test"
End If
End Sub
________
ford n series tractors history
Last edited: