Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Case of the missing Resources (Access 2000)

    I know the answer to this is going to be obvious, but.... Why is it when I click on tools in one form's module, the references are alive and well and available. Yet, on the next form, References are greyed out, else not available as is neither debug for compile purposes
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Case of the missing Resources (Access 2000)

    You may have a corrupted form.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Case of the missing Resources (Access 2000)

    Good Morning Charlotte,
    Good news, bad news. The good news is, when I got back to the form, the References were there. Bad news on two counts: The ongoing stupid 'Network' error which has been discussed in the past and is apparently tied to a wonderful Microsoft problem with DLL's fighting each other, and in spite of apparently having all references present, cannot access the "FindFirst" command. Maybe you can clarify for me how in some cases I can see "Find" and "FindFirst", etc., but in other cases, such as this one, I can only see "Find". Where exactly are these little ######s hiding? In my references I show:
    Visual Basic For Applications; MS Access 9.0 Object Library; MS DAO 3.6 Object Library; MS Office 9.0 Object Library; OLE Automation and MS Visual Basic for Applications Exensibility 5. Thanks in advance for helping me with this.
    Cheers,
    Andy

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Case of the missing Resources (Access 2000)

    What do you mean, you cannot "access" the findfirst command or cannot "see" it? Your reference to DLL's fighting each other is also obscure. Please don't rely on general references to past discussions, since most of us don't have time to go looking for those other threads in order to make sense of a current one.

    Where are you looking? The VBE is somewhat context sensitive. You're going to have to explain more before anyone can come up with an answer. Are you saying you can't find it in help or it isn't an available method in intellisense, or what? What kind of object are you looking from?
    Charlotte

  5. #5
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Case of the missing Resources (Access 2000)

    My apologies for being less than clear. Forget "Network" error. The following is a portion of the code that I'm working on which came from another source.

    Function GetLineNumber()
    Dim RS As Recordset
    Dim CountLines
    Dim F As Form
    Dim KeyName As String
    Dim KeyValue
    Set F = Form
    'KeyName = "CompanyName"
    'KeyValue = [Name]
    KeyName = "LastNameFirst"
    KeyValue = [CompanyName]
    On Error GoTo Err_GetLineNumber
    Set RS = F.RecordsetClone
    Select Case RS.Fields(KeyName).Type
    Case DB_INTEGER, DB_LONG, DB_CURRENCY, DB_SINGLE, _
    DB_DOUBLE, DB_BYTE
    RS.Find "[" & KeyName & "] = " & KeyValue


    My question is:
    In one form, when I start typing code

    RS.Find I get a selection dropdown that offers
    Fields
    FillCache
    Filter
    FindFirst
    FindLast
    FindNext
    FindPrevious
    GetRows

    In the current form, when I start typing code
    RS.Find I get a selection dropdown that offers
    Fields
    Filter
    Find
    GetRows

    I'm not concerned at this point as to whether or not the code works, I would appreciate just finding out why there is a difference in the two, as I so amateurishly referred to as inaccessable dropdowns or unavailability of FindFirst, FindLast, FindNext, etc.
    Cheers,
    Andy

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Case of the missing Resources (Access 2000)

    The problem probably comes from not specifying the object model when you declare the object variable. Find is an ADO method and FindFirst is a DAO method. If you declare an ambiguous object like Recordset, Access isn't sure which object model you want to use. If you always declare your variables explicitly (i.e., DAO.Recordset or ADODB.Recordset), you should get the right set of methods and properties from intellisense and will get fewer syntax errors as a bonus.

    Since you're using the Recordsetclone method later in the code, you need to declare RS as a DAO.Recordset so Access isn't confused. You can play with the order of the references when you have both object models set, but it's much clearer and safer to specify them when you declare the objects. It isn't only recordsets: properties, fields, parameters, etc., all are names for objects in both models but with different methods and properties.
    Charlotte

  7. #7
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Case of the missing Resources (Access 2000)

    If at first you don't succeed. Original program which contains the code which I wish to reuse was an Access 97 program converted to Access 2000. After importing, the "FindFirst" capability no longer existed within the code. I changed the opening code as per your instructions, ie.

    From:
    Function GetLineNumber()
    Dim RS As Recordset
    Dim CountLines
    Dim F As Form
    Dim KeyName As String
    Dim KeyValue

    Set F = Form
    KeyName = "productid"
    KeyValue = [ProductID]

    On Error GoTo Err_GetLineNumber
    Set RS = F.RecordsetClone
    ' Find the current record.
    Select Case RS.Fields(KeyName).Type
    ' Find using numeric data type key value.
    Case DB_INTEGER, DB_LONG, DB_CURRENCY, DB_SINGLE, _
    DB_DOUBLE, DB_BYTE
    RS.FindFirst "[" & KeyName & "] = " & KeyValue

    To:

    From:
    Function GetLineNumber()
    Dim RS As DAO.Recordset
    Dim CountLines
    Dim F As Form

    And got the error message:

    Compile error: Method or Data Member not found

    At this point the references are 'greyed' out and unavailable.

    I'd appreciate your kind comments on the situation at this point and anyone else who cares to jump in and show me the light.
    Cheers,
    Andy

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Case of the missing Resources (Access 2000)

    Do you have a reference set to the DAO 3.6 library? If not, it still won't work. You didn't say which line gives you the error, so it's hard to tell whether you've got a bad database, a bad installation, or a bad reference.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •