Re: Function Find

From: Scott McDaniel (scott_at_NO___Spam--thedatabaseplace.net)
Date: 05/23/04

  • Next message: Douglas J. Steele: "Re: Function Find"
    Date: Sun, 23 May 2021 12:34:07 -0400
    

    You need to set a reference to the DAO library. To do this, open the Visual
    Basic Editor (Ctrl + G), select Tools-References and find/check Microsoft
    DAO xx Library, where xx is the highest number you find listed.

    However, you should get into the habit of disambigulating your objects:

    Dim rst As DAO.Recordset
    Dim adoRST As ADODB.Recordset
    dim dbs As DAO.Database

    etc etc

    "Paul" <rousseau@nb.sympatico.ca> wrote in message
    news:DA2sc.46570$Np3.1959735@ursa-nb00s0.nbnet.nb.ca...
    > I use to have a program running under Access 98, and since we moved to
    > Access 2000 the following code do not work, I have the message:
    > Run time error 3251,
    > Operation is not support for this type of object.
    > There is the code:
    > Private Sub Command30_Click()
    >
    > Dim dbsLetter As Database
    > Dim tblLetter As Variant
    > Set dbsLetter = CurrentDb
    > Set tblLetter = dbsLetter.OpenRecordset("Letter_3_Table")
    > If (Me![ToCC] <> "" Or Me![CC2] <> "" Or Me![CC3] <> "" Or Me![CC4] <> "")
    > Then
    > tblLetter.FindFirst ("Issue_ID = " & Me![IssueID])
    > tblLetter.Edit
    > tblLetter![CCSend].Value = Me![ToCC]
    > tblLetter![CC2Send].Value = Me![CC2]
    > tblLetter![CC3Send].Value = Me![CC3]
    > tblLetter![CC4Send].Value = Me![CC4]
    > tblLetter.Update
    > End If
    > dbsLetter.Close
    > DoCmd.RunMacro ("send email")
    > MsgBox ("File has been sent by email")
    > End Sub
    > Any help would be appreciate.
    > Paul
    >
    >
    >


  • Next message: Douglas J. Steele: "Re: Function Find"

    Relevant Pages