
Data Cotrol (DAO) and Index
I have a small program that has the Data control linked with four text
boxes,
and a command button labeled "Find". This a price list data base therefore I
just want the user
to type in his selected Catalogue number and have it appear in the text
boxes.
Everthing seems to work fine except for an error saying that my table is not
an
index and refer to tabledef object?
this is my code...
Private Sub Command1_Click()
Dim prompt As String
Dim searchstr As String
prompt = "Please enter the catalogue number."
searchstr = InputBox(prompt, "Cat Number Search")
Data1.Recordset.Index = "PriceList"
Data1.Recordset.Seek "=", searchstr
If Data1.Recordset.NoMatch Then
MsgBox ("Sorry that catalogue number is not correct,please try again.")
Data1.Recordset.MoveFirst
End If
End Sub
The error occurs in the .."Data1.Recordset.Index= "PriceList"...
This is the name of my table.
Hoping that someone can help a newbie.
Many Thanks....Rob