I wonder if someone can help me, in the past I have been using the following code in access 2000 with outlook 2000.
I now have office 2003 installed and whenever i try and run the code i get the following error message
compile error:user-defined type not defined.
any help would be appreciated
Regards
Paul
Code:
Private Sub Form_Current()
'ResumeClickYes
If Form!NewCalls.Value <> "" Then
Dim otk As Outlook.Application
Dim eml As Outlook.MailItem
Dim rs As Recordset
Dim vMsgString As String
Dim rsM As Recordset
' Open your table and build your distribution list
Set rs = New ADODB.Recordset
With rs
.Open "tblEMail", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
.MoveFirst
Do While Not .EOF
Strlist = Strlist & rs.Fields("EMail").Value & ";"
rs.MoveNext
Loop
Set rsM = New ADODB.Recordset
With rsM
.Open "qryNewCall", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rsM.MoveFirst
Do While Not .EOF
vMsgString = vMsgString & "CallID: " & rsM![CallID] & ", " & "CreatedDate: " & rsM![CreatedDate] & ", " & "Status: " & rsM![Status] & ", " & _
"Critical: " & rsM![Critical] & ", " & "Site: " & rsM![Site] & Chr$(13)
rsM.MoveNext
Loop
Set otk = CreateObject("Outlook.Application")
Set eml = otk.CreateItem(olMailItem)
With eml
.To = Strlist
.Subject = "New Calls"
.Body = "New Calls Have Been Added To The Database." & vbCrLf & vbCrLf & vMsgString
.Send
End With
Set eml = Nothing
rs.Close
Set rs = Nothing
End With
End With
otk.Quit
Set otk = Nothing
'SuspendClickYes
Else
End
End If
End Sub
compile error:user-defined type not defined.
any help would be appreciated
Regards
Paul