Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Unable to send emails in Access 2007

$
0
0
Hi,

I just converted my access database(2000) to access 2010. Everything works fine expect the email code.
here is my part of email code.
(note: when I debug error come in second last line of code, I know it has to do something with including references) :S

Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim eCount As Integer

Dim SDb As ADODB.Connection
Dim rstStudent As ADODB.Recordset
Dim strSQL As String

strFromEmail = Me![fromEmailAddress].Value
strToEmail = Me![toEmailList].Value
strSubject = Me![subject].Value
strMessage = Me![message].Value

If Not IsNull(strMessage) And Not IsNull(strFromEmail) And Not IsNull(strToEmail) And Not IsNull(strSubject) Then

'Ensure that all the fields are filled
If strMessage <> "" And strToEmail <> "" And strFromEmail <> "" And strSubject <> "" Then
eCount = 0
Set db = CurrentDb()
If strToEmail = "F_J_New_Students_DocumentDate" Then
strDate = InputBox("Enter cutoff Date (mm/dd/yy)")
strSQL = "SELECT * FROM " & strToEmail & " where Document_Date>#" & strDate & "#"
Else
strSQL = "SELECT * FROM " & strToEmail & " Order by Last_Name, First_Name"
End If

Set rstStudent = db.OpenRecordset(strSQL)
db.OpenRecordset (strSQL)

Viewing all articles
Browse latest Browse all 13329

Trending Articles