Results 1 to 7 of 7
  1. #1
    darklite is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    41

    compile error

    does anyone know what might be causing a compile error? I'm not at the computer where this problem is happening, but the message is:



    compile error: user defined type not defined.


    Sub SendEmails()
    Dim db As DAO.Database, rst As Recordset, StrSQL As String, qdf As QueryDef, TblSize As Long
    Dim rst2 As Recordset
    Dim rstArchive As Recordset
    Dim olapp As New Outlook.Application
    'Dim olapp As Object

    Help!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Sub SendEmails()
    Dim db As DAO.Database, rst As DAO.Recordset, StrSQL As String, qdf As QueryDef, TblSize As Long
    Dim rst2 As DAO.Recordset
    Dim rstArchive As DAO.Recordset
    Dim olapp As New Outlook.Application
    'Dim olapp As Object

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Check that the DAO and Outlook references are both checked in Tools/References.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    darklite is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    41
    Thanks, I'll try that.

  5. #5
    darklite is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    41
    Paul, thanks, that seemed to work!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo. Weekend's suggestion to disambiguate the declarations is also a good idea, but I don't think it was causing the error (and QueryDef should also be DAO).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    posting so i can mark this thread solved (Thanks Matrix for allowing all participants to mark threads solved!)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. compile error: expected end of statement
    By RedGoneWILD in forum Programming
    Replies: 5
    Last Post: 07-29-2010, 10:12 AM
  2. Replies: 1
    Last Post: 04-24-2010, 09:57 AM
  3. Replies: 7
    Last Post: 03-03-2010, 11:06 AM
  4. Replies: 23
    Last Post: 03-26-2009, 06:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums