Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Partial Answer - SendObject Open Outlook based on query results??

Status
Not open for further replies.

vistor

Technical User
Dec 22, 2000
164
US
I have come up with this Function, but it works only with a table, not a query. Anyone know how to write it so the SQL statement can have a query? SQL = "SELECT Email FROM qryProduct1;"

Function Email()

Set db = CurrentDb
SQL = "SELECT Email FROM Company;"
Set rs = db.OpenRecordset(SQL)

rs.MoveFirst

Do While rs.EOF = False
Email = Email & rs!Email & ";"
rs.MoveNext
Loop

DoCmd.SendObject acSendNoObject, , , , , Email, , , , True

End Function
 
i don't know if this is what you want... but if you open your query in sql view, copy every thing out of that... paste that into your code as your sql source... and make sure it's all on one line... it should work for you...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top