DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Method or data member not found?

  1. #1
    Nate Guest

    Method or data member not found?


    Hi Developer,

    I created an application ( microsoft access)with a standard heading and a
    tab control with 3 pages under the heading. I named the form SalesContactMainform.
    I put a textbox with a command button for search on the heading. Below is
    my code for the search function. When I type "MyRs.(dot)", I don't have Findfirst
    member in the lists. Also, when I type "If Not MyRs.(dot)" I don't see the
    NoMatch member. How do I get the method or data member?


    Private Sub Search_Click()
    'Seaching for Customer through Recordset
    'On Error GoTo Search_Click_Err
    Dim Criteria As String
    Dim MyRs As Recordset

    'Dim SalesContactMainForm As Form
    Set MyRs = Forms![SalesContactMainForm].RecordsetClone
    Criteria = "[CustomerName] "
    MyRs.Findfirst Criteria
    If Not MyRs.NoMatch Then
    Forms![SalesContactMainForm].Bookmark = MyRs.Bookmark
    End If
    MyRs.Close
    Set MyRs = Nothing
    End Sub

    Thanks for your help

    Nate

  2. #2
    Douglas J. Steele Guest

    Re: Method or data member not found?

    Access 2000 or 2002, right? By default, they use ADO, not DAO.

    With any code module open, select Tools | References from the menu bar,
    scroll through the list of available references until you find the one for
    Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
    using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
    Library

    If you have both references, you'll find that you'll need to "disambiguate"
    certain declarations, because objects with the same names exist in the 2
    models. For example, to ensure that you get a DAO recordset, you'll need to
    use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
    Dim rsCurr As ADODB.Recordset)

    The list of objects with the same names in the 2 models is Connection,
    Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
    and Recordset



    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele


    "Nate" <natem@hotmail.com> wrote in message news:3ced5ff5$1@10.1.10.29...
    >
    > Hi Developer,
    >
    > I created an application ( microsoft access)with a standard heading and a
    > tab control with 3 pages under the heading. I named the form

    SalesContactMainform.
    > I put a textbox with a command button for search on the heading. Below is
    > my code for the search function. When I type "MyRs.(dot)", I don't have

    Findfirst
    > member in the lists. Also, when I type "If Not MyRs.(dot)" I don't see the
    > NoMatch member. How do I get the method or data member?
    >
    >
    > Private Sub Search_Click()
    > 'Seaching for Customer through Recordset
    > 'On Error GoTo Search_Click_Err
    > Dim Criteria As String
    > Dim MyRs As Recordset
    >
    > 'Dim SalesContactMainForm As Form
    > Set MyRs = Forms![SalesContactMainForm].RecordsetClone
    > Criteria = "[CustomerName] "
    > MyRs.Findfirst Criteria
    > If Not MyRs.NoMatch Then
    > Forms![SalesContactMainForm].Bookmark = MyRs.Bookmark
    > End If
    > MyRs.Close
    > Set MyRs = Nothing
    > End Sub
    >
    > Thanks for your help
    >
    > Nate




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center