Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    6

    Question Unanswered: Converted Access 97 to Access2002 VB Errors

    I have converted an Access97 database to Access2002. This db has one very small module and now it will not even compile in the Access2002 version. I have gone into the references and unchecked the Missing libraries and checked the new libraries, but I keep getting a compile error of: "Method or Data Member Not Found" Does anybody have any ideas before I toss my computer out the window?

    Here is the code:
    Function LineNumberUpdate()

    Dim DB As Database
    Dim rstUpload As Recordset
    Dim IntCount As Integer
    Dim InvNum As String

    Set DB = CurrentDb()
    Set rstUpload = DB.OpenRecordset("qryUploadTempOrder")

    rstUpload.MoveFirst

    IntCount = 1
    InvNum = rstUpload.Fields("Invoice Number")

    Do Until rstUpload.EOF
    If rstUpload.Fields("Invoice Number") = InvNum Then
    rstUpload.Edit
    rstUpload.Fields("Distribution Line Number") = IntCount
    rstUpload.Update
    IntCount = IntCount + 1
    rstUpload.MoveNext
    Else
    InvNum = rstUpload.Fields("Invoice Number")
    IntCount = 1
    End If
    Loop

    End Function


    The compile error highlights the "rstUpload.Edit" line.

    Thanks,
    NMellick

  2. #2
    Join Date
    Jul 2002
    Location
    Australia
    Posts
    147
    It's because you'll have a reference to ADO above the DAO reference.

    Moving the DAO library refrence above the ADO one will solve the problem, however to avoid it in the first place, explicitly dimension your variables, so:
    Code:
    Dim DB As Database 
    Dim rstUpload As Recordset
    becomes:
    Code:
    Dim DB As DAO.Database 
    Dim rstUpload As DAO.Recordset
    Cheers,
    Andrew
    There have been many posts made throughout the world.
    This was one of them.

Posting Permissions

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