Data connections

seany

Registered User.
Local time
Today, 02:16
Joined
Sep 1, 2003
Messages
53
Can someone please time me want is wrong with is code. I am trying to send a email for each person in a table called Tbl_Uses. I am new to using data connections so is there something basic at the start which is need to do?


Function email()

Dim Report As String
Dim emailaddress As String
Dim sql As String
Dim rs As Recordset

Report = "Rpt_Email_PassTo"


Set rs = CurrentDb.OpenRecordset("Tbl_Users", dbOpenSnapshot)
If Not rs.BOF Then
rs.MoveFirst

Do Until rs.EOF
emailaddress = rs("email")
DoCmd.SendObject acSendReport, Report, acFormatRTF, email, , , "Planning Application register", "", "No"
rs.MoveNext

Loop
End If
rs.Close

End Function
 
What version of Access are you using?
 
I am using 2000. I have changed the dbOpenSnapshot to DB_OPEN_TABLE. And is error with data missmatch.
 
I can understand how this has something to do with my problem. Can you please give me some more guide ness please. Can't understand why my code is not working.
 
What more do you need? :confused:

That whole article lists the problem, why it happens, and how to resolve it.
 
Hi,

All I need to do was turn Mircosoft DAO reference on.

Thanks
 

Users who are viewing this thread

Back
Top Bottom