Re: Function Find

From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 05/23/04


Date: Sun, 23 May 2021 14:15:56 -0400

While it's true that he needs a reference to DAO, I would think he's got
that, otherwise it would fail on the Dim dbsLetter As Database statement
with a "User Type not found" error.

This question was multiposted, and I believe the correct answer's already
been given in one of the other newsgroups to which he posted. The suggestion
made there was that Dim tblLetter As Variant should be rewritten to declare
the variable as Dim tblLetter As DAO.Recordset

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Scott McDaniel" <scott@NO___Spam--thedatabaseplace.net> wrote in message
news:A_mdna_JQZgITi3dRVn-sQ@comcast.com...
> 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
> >
> >
> >
>
>


Relevant Pages