PrincessBretti
Registered User.
- Local time
- Today, 00:08
- Joined
- Mar 16, 2000
- Messages
- 14
Hi,
I have a problem using the seek command, here is the code:
Dim rstQuest As Recordset
Dim dbsBDC As Database
Set dbsBDC = OpenDatabase("BDC.mdb")
Set rstQuest = dbsBDC.OpenRecordset("Questionnaire", dbOpenTable)
With rstQuest
.Index = "ID"
.Seek "=", Me.ID
If .NoMatch Then
MsgBox "ID not found!"
End If
.Close
End With
It always comes up with no match even when it shouldn't!
When I changed the primary key in the table to "ida" rather than "ID" and changed the .index value to the same in the above code, I recieve an error saying that the field "ida" is not a primary key in the table, therefore I think the above is pointing to the wrong place but don't know why, can anybody help?
Thanks
Bretti
I have a problem using the seek command, here is the code:
Dim rstQuest As Recordset
Dim dbsBDC As Database
Set dbsBDC = OpenDatabase("BDC.mdb")
Set rstQuest = dbsBDC.OpenRecordset("Questionnaire", dbOpenTable)
With rstQuest
.Index = "ID"
.Seek "=", Me.ID
If .NoMatch Then
MsgBox "ID not found!"
End If
.Close
End With
It always comes up with no match even when it shouldn't!
When I changed the primary key in the table to "ida" rather than "ID" and changed the .index value to the same in the above code, I recieve an error saying that the field "ida" is not a primary key in the table, therefore I think the above is pointing to the wrong place but don't know why, can anybody help?
Thanks
Bretti