This is the code i'm using, error line highlighted:
It is giving me Runtime 3800, "FieldName" is not an index in this table.
In the table CAM_Portfolio_Query, I set the [Account-Number] field to be both the key and indexed, with no duplicates allowed.
Yet i still get this error. Any thoughts?
Thanks,
Guy
Code:
Option Compare Database
Public Function VerifyAcct(AcctNum As String)
Dim dbDatabase As Database
Dim rsAcctNumber As Recordset
Set dbDatabase = CurrentDb
Set rsAcctNumber = dbDatabase.OpenRecordset("CAM_Portfolio_Query", dbOpenTable)
With rsAcctNumber
[COLOR=red][B] .Index = "Account-Number"
[/B][/COLOR] .Seek "=", AcctNum
If .NoMatch = True Then
MsgBox "NotFound"
Else
MsgBox "Found"
End If
End With
End Function
It is giving me Runtime 3800, "FieldName" is not an index in this table.
In the table CAM_Portfolio_Query, I set the [Account-Number] field to be both the key and indexed, with no duplicates allowed.
Yet i still get this error. Any thoughts?
Thanks,
Guy