SEarch Question in Access 2007

Posted on 2011-10-26
Last Modified: 2012-05-12
Hi everyone,

I am getting the User Defined Type Not Found Compile error when this coding runs.

Dim rs As DAO.Recordset is highlighted in Yellow

Public Sub Command9_Click()

Dim rs As DAO.Recordset

Set rs = Me.Recordset.Clone
rs.FindFirst "[SSN] = '" & Me.Text10 & "'"
If rs.NoMatch = True Then
    MsgBox "There are No Records Found for this Social Security Number.  Please Try Again"
    Me.Bookmark = rs.Bookmark
End If
End Sub

Question by:jjc9809
    LVL 119

    Expert Comment

    by:Rey Obrero
    * see if you have any reference prefixed with "MISSING", uncheck and locate available version of library if there is any.

    if you can get an image of the Reference window, post it here..
    LVL 61

    Accepted Solution

    In addition to cap1's comment, specifically make sure that you have a reference to Microsoft DAO 3.6 (or whatever version) checked.

    You can locate your references though the VBA Editor's menu:

    Tools -> References

    Author Closing Comment

    mbizup ,

    You solved the problem.  The references dialog box had the 3.6 DAO unchecked.  When I checked it and ran the program no more problems.  


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now