Primary Key not acceptable for "Seek?"
I'm trying to learn to use the DAO library and am having a problem with using Seek on a table. I am trying to use it against tblAuthUsers2, where "AuthInit" is the Primary Key. I am getting an error saying that the field "Authinit" must be an Index! (I thought a PK WAS an index???) When I run Analyze it shows the only index in tblAuthUsers2 is "Primary Key". It's data type is text, and interestingly "required Property" was false- but when I changed it to "True" it still errored with the same message.
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim strUserPasswordInput As String ' hold password user gives Dim varFoundUserPW As Variant ' store
Dim strUserInitInput As String ' store user initials,
Dim strUserPWStored As String
Dim strUserInitStored As String
Dim intUserLevelStored As Integer
Set db = CurrentDb
Set rec = db.OpenRecordset("tblAuthUsers2")
rec.Index = "AuthInit" ' set up to use seek,
rec.Seek "=", strUserInitInput
Am I missing something important here? Is there something else I need to review? (Is the table goofy?)
Thanks,
Loralee
|