Partial answer -Access Question - SendObject - Another way

occie

New Member
Joined
Sep 17, 2002
Messages
10
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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
On 2002-10-01 10:42, occie wrote:
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

Hi no need to post to a new thread, I've part answered your question in the other thread.
Can you use that thread and detail anything else you need, as mentioned it should really be Excel related.
 
Upvote 0
Yess, sorry - our posts are missing each other. I just replyed to this before I got your last message. thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,203,751
Messages
6,057,147
Members
444,908
Latest member
Jayrey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top