Access 97 to 2000

  • Thread starter Thread starter Derek Riley
  • Start date Start date
D

Derek Riley

Hi All,

I have recently updated my access program to version 2000,
and have a problem with FindFirst command,
The error I receive is "Method or data member not found (Error 461)"

Here is the code, any help on this would be much appreciated.

Regards,
Derek


Function FindCusAccount(ACusID As String) As String
Dim OutName As String

Dim SMSpace As Workspace
Dim SMDB As Database, SMTable As Recordset
Dim criteria As String

Set SMSpace = DBEngine.Workspaces(0)
Set SMDB = SMSpace.OpenDatabase(CentralDBName)
Set SMTable = SMDB.OpenRecordset("TR_Customer", DB_OPEN_DYNASET) '
Open table
criteria = "[Customer ID] = '" & ACusID & "'"

SMTable.FindFirst criteria ' Find first
occurrence.
If SMTable.NoMatch Then 'DoCmd Beep
OutName = ""
Else
OutName = SMTable![Account]
End If
SMTable.Close
FindCusAccount = OutName ' Output result
End Function
 
You may need to set a reference to the DAO library if it isn't already set
(open a code window, go to tools --> references, add..), then explicitly
identify DAO in your code. For example:

Dim SMDB as DAO.Database
,etc...

Robert Smith
Kaizen Software Solutions
http://www.kzsoftware.com
 
Back
Top