Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Thailand
    Posts
    81

    Angry Unanswered: PANIC!!!!!!!! New ADODB.Recordset

    Have a mail all function to send massmail to all contacts. Works like a charm in the new mdb-file I created just for doing this.

    But when I export everything to my main database-file it tells me

    that this perfectly good Ado line is bad:

    Dim rstTblCONTACTS As New ADODB.Recordset

    It tells me that the User defined type is not defined.

    I think the problem is DAO/ADO related. My main database was made in access 97 and then converted. Maybe its set to use DAO. How do I make recognise ADO? I have read it somewheree but can´t remeber where.

    If I export everything to a new empty database everything works fine. Its just where I want the function it wont work.

    Entire function:
    ..............
    Option Compare Database
    Public SendString As String
    ________________________
    Function mailallC()


    Dim rstTblCONTACTS As New ADODB.Recordset

    'Open the Recordset to Customers
    rstTblCONTACTS.ActiveConnection = Application.CurrentProject.Connection
    rstTblCONTACTS.CursorType = adOpenKeyset
    rstTblCONTACTS.Open "TblCONTACTS"


    SendString = ""

    If MsgBox("Send Email" & Chr(13) & _
    "to all Contacts using Microsoft Outlook?", 4) = 6 Then

    With rstTblCONTACTS


    Do Until .EOF
    ' Create the Invoice report Filter used by the Report_Open
    ' event.

    SendString = SendString & !PersonalEmail & ";"
    .MoveNext
    Loop

    SendString = Left$(SendString, Len(SendString) - 2)


    DoCmd.SendObject , "", "", [SendString], "", "", "", "", True, ""

    End With
    End If

    rstTblCONTACTS.Close

    End Function

  2. #2
    Join Date
    Jan 2002
    Location
    UK
    Posts
    67
    Hi Johnny,

    How is life on your end. You seem to be very busy doing all the stuff with your database.
    is the first query working fo ryou.

    BTW for this query, go to the Tools--> References.
    This will opo up a window up like that.

    and just set the options as shown


    take care and enjoy,

    Xzone

  3. #3
    Join Date
    Apr 2002
    Location
    Thailand
    Posts
    81
    Life´s great especially now that I have found this setting. Thanks to you. Phew. The boss is coming tomorrow morningto see my work... Close call.

    I think some of your instructions fell off though.

    But the "Tools...References" was enough to locate it. For anyone else having the same trouble - First of all the tools are in the Code environment.

    And the one you need to enable is:
    Microsoft ActiveX Dataobjects 2.7 Library.



    Originally posted by xzone
    Hi Johnny,

    How is life on your end. You seem to be very busy doing all the stuff with your database.
    is the first query working fo ryou.

    BTW for this query, go to the Tools--> References.
    This will opo up a window up like that.

    and just set the options as shown


    take care and enjoy,

    Xzone

  4. #4
    Join Date
    Feb 2002
    Posts
    64

    Tip

    JD,

    Just a little tip, in case you didn't check, make sure when you mail all your contacts in your database you aren't sending everyone's e-mail address to everyone else.

    This happened where I used to work where someone (a not very clever someone) sent an e-mail to all our contacts, and everyone's e-mail address was in the To section...

    If you've already checked, please disregard...

    TJ

Posting Permissions

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