Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2006

Tip: Looking for answers? Try searching our database.

Query for Email Address Then send to Outlook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cmichaud@ufl.edu - 28 Mar 2006 16:19 GMT
I am trying to run a query that will return me email addresses based on
hobby.  Then i want it to take all the cooresponding email addresses
and put them in the "to:" field of outlook.  It can leave the rest of
the email blank.  I have NO idea how to do this or even get started.

Can you help...please.
mscertified - 28 Mar 2006 17:03 GMT
Something like this:

Dim rs as ADODB.recordset, strEmails as string, strSQL as string
strSQL = "SELECT MyEmail FROM MyTable WHERE MyHobby = 'Whatever'"
strEmails = vbnullstring
rs.Open strSQL,CurrentProject.Connection,adOpenForwardOnly,adLockReadOnly
while not rs.eof
  if strEmails = vbnullstring Then
     strEmails = rs.fields("MyEmail").value
  else
     strEmails = strEmails & ";" & rs.fields("MyEmail").value
  end if  
  rs.movenext
wend
rs.close
set rs = nothing
' strEmails now contains the Emails string

-Dorian

> I am trying to run a query that will return me email addresses based on
> hobby.  Then i want it to take all the cooresponding email addresses
> and put them in the "to:" field of outlook.  It can leave the rest of
> the email blank.  I have NO idea how to do this or even get started.
>
> Can you help...please.
cmichaud@ufl.edu - 28 Mar 2006 17:15 GMT
where do i enter that in.  and can i use a form to select the hobby for
the query....i mean i know i can, but can i use it with this.  smell my
newness?

> Something like this:
>
[quoted text clipped - 22 lines]
> >
> > Can you help...please.
BettyB - 30 Mar 2006 15:42 GMT
I am trying to do the same thing.  If I do a select all, copy, paste . . .
the field name is included with the data.  Is there a way to avoid the field
name from be included?

> I am trying to run a query that will return me email addresses based on
> hobby.  Then i want it to take all the cooresponding email addresses
> and put them in the "to:" field of outlook.  It can leave the rest of
> the email blank.  I have NO idea how to do this or even get started.
>
> Can you help...please.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.