PC Review


Reply
Thread Tools Rate Thread

Mailing Files Access 2000 HELP!

 
 
snappl3
Guest
Posts: n/a
 
      25th Apr 2008
I am using Access 2000. Below is my coding on a macro which I am using to
automate a emails to be sent out which include an excel file. This file will
be sent out to those vendors who are pulled up using a query. When I get
down to the line "strEmail = rs!("Email") it turns up a compile error stating
"Type-declaration character does not match declared type". Does anyone have
a solution to this problem? I'd really appreciate it! Thanks! *"Info"
denotes any information that I can't share outside of my company

Sub Checklist()

Dim rs As New ADODB.Recordset
Dim fso As New FileSystemObject
Dim mail As New Outlook.Application
Dim db As ADODB.Connection

Set db = CurrentProject.Connection
rs.CursorLocation = adUseClient

strSQL = " Info"
strSQL = strSQL & " FROM Info]"
strSQL = strSQL & " WHERE ((([Info].[Date of C-TPAT Expiration]) <=
DateAdd('m', 6, Date())))"
strSQL = strSQL & " ORDER BY [Info].[Date of C-TPAT Expiration];"

rs.Open strSQL, db

If rs.RecordCount < 1 Then
rs.Close
Exit Sub
End If

mail.CreateItem (olMailItem)

strFile = fso.GetFile("File Location")

With rs
Do Until .EOF

strEmail = rs!("Email")




'DoCmd.SendObject(,,, _
'To:=[Queries]![ClientEmails]![ContactEmail], _
'Subject:="Supplier Checklist", _
'MessageText:="Message Text",C:\Info\Info.xls)


..MoveNext
Loop
..Close
End With

Set rs = Nothing

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating mailing labels from an access data base customer mailing =?Utf-8?B?bGFkYXJpZHVib2lz?= Microsoft Access Getting Started 7 26th Jul 2006 10:39 PM
how do I get mailing list to print mailing labels? =?Utf-8?B?S0lXSUtJRA==?= Microsoft Access External Data 1 4th Apr 2006 12:35 AM
creating a smart mailing list mailing list =?Utf-8?B?S3JvZGdl?= Microsoft Access 2 3rd Mar 2006 05:15 AM
how do i convert MS Word mailing labels into an Excel mailing lis. =?Utf-8?B?dW5yaHlsbA==?= Microsoft Excel Misc 1 4th Feb 2005 01:19 AM
Mailing using external mailing list (not Contacts) Byrocat Microsoft Outlook Contacts 1 5th Nov 2004 11:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:27 PM.