Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 470
  • Last Modified:

user-defined type not defined message

Public Function GetNextNumber() As Long
I am getting this message ...user-defined type not defined...???
   
 Dim rs As DAO.Recordset
    Set rs = CurrentDb.OpenRecordset("tblReportCount")
    If rs.EOF = True Then
        rs.AddNew
        GetNextNumber = rs!CurrentCount
        rs.Update
    Else
        rs.AddNew
        GetNextNumber = rs!CurrentCount
        rs.Update
        rs.Delete
    End If
    rs.Close
    Set rs = Nothing
End Function
0
msummerma
Asked:
msummerma
  • 2
1 Solution
 
Ryan ChongCommented:
try check and make sure you got M$ DAO Object Library from your Reference?
0
 
Ryan ChongCommented:
If M$ DAO Object Library is not available from Reference, you can try click the Browse button, and find it at:

<Program Files folder>\Common Files\Microsoft Shared\DAO

and find for the respective DLL (like DAO350.DLL, dao360.dll)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
ryancys is very likely correct... 'User-Defined type not defined' usually means that you forgot to set a refernect, say to DAO.Recordset, and without it Access doesn't know what a DAO.Recordset is.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now