Access 97 to 2000

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
 
R

Robert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top