I am currently in the process of making/maintaining a database for a school club. I started the database mostly from scratch and i have a pretty good familiarity with Access (been using it for almost a year), but i hit a wall in terms of something i want to do, and i have a feeling i either need to make an expression, VBA, or macro model to do what i need. I need some direction as to which is the easiest to do, and exactly how i should go about doing it.
I want to be able to create a button on the main page of my database that will open an outlook email message and put all of the email addresses from a column in one of my queries into said outlook mail's "to" form. I do not want it to automatically send the email or attach anything to the email, I just need it to simply fill out the "to" form so that it will act as an active email list.
Any advice would be appreciated, but i have to be honest that i have little experience in VBA. I am not entirely computer illiterate and will probably be able to understand/alter existing code with a little advice. I will provide a little information about my database as i am sure it might be useful for explanation:
Version of Access: Access2003
Name of master table: Membership Master Table
Name of Query based off master table: Current Members
Name of column that email addresses appear in: E-mail
Program to open the emails in: Outlook2007
I appreciate all of the help/advice.
Thank You,
Scott
1 5262
Try this in OnClick event of your button: - Public rst As Recordset
-
Public qdf As QueryDef
-
Dim cID as Variant
-
Dim MyString As String
-
-
cID = Me.cID 'Me.cID is presumed to be ID of your current member
-
-
Set qdf = CurrentDb.CreateQueryDef("", "SELECT E-Mail FROM [Current Members] WHERE CurrID= " & cID & ";")
-
Set rst = qdf.OpenRecordset
-
If rst.BOF Then
-
Exit Sub
-
Else
-
rst.MoveFirst
-
MyString = ""
-
Do Until rst.EOF
-
MyString = MyString & rst![E-Mail] & ";"
-
rst.MoveNext
-
Loop
-
-
-
DoCmd.SendObject , , , Mystring
-
Only the CreateQueryDef part could be a little problem, so you need to be carefull there.
Put SQL with the right WHERE part and you have it.
This is one example from my database: - Set qdf = CurrentDb.CreateQueryDef("", "SELECT * FROM qAiring WHERE abID = " & MovID & "AND aRunNo = " & Run & ";")
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: melsink |
last post by:
I am trying find the best method to send email from my a contact access
database. I would need to send group emails and save the transaction in
access (is. time/date, subject of email and who the emails went to). Using
MS Outlook 2003, I would like access to populate the to and cc fields in
outlook.
Thanks
Mel
|
by: scott_baird |
last post by:
I have an email macro setup (maybe I should go another way, but that
was the quickest at the moment...) and what I would like to do is
automate the "to" addressee of the email it generates for sending.
What I have is an email button that creates a report based on a
property address on a form (driven by a query which has criteria such
as forms!frmPROPERTY!address). That open form also has an email
address on it for the owner, and I would...
|
by: Tomdhu |
last post by:
I've got a Contacts & Events database in Access 2K where contacts
attend various events.
At present, where I want to group e-mail all the attendees who are
going to attend a particular event, I run a macro which runs a select
query which strips out and exports a list of their e-mail addresses (
separated by commas) into a text file. I then copy the CSV e-mail
addresses and paste them into the BCC field of Outlook.
I'd love to have a...
|
by: Mike Charney |
last post by:
Is there a simple way to send SMTP email from Access VBA?
Mike
m charney at dunlap hospital dot org
|
by: Liam.M |
last post by:
hey guys,
I have one last problem to fix, and then my database is essentially
done...I would therefore very much appreciate any assistance anyone
would be able to provide me with.
Currently I have set up a Query to show only records that meet a
certain criteria...therefore excluding all of the records that do not
meet this criteria (just for the record the criteria is any record
within my database that falls within two months of its "Due...
| |
by: ShyGuy |
last post by:
Is there a way to fill the To: box in Outlook using email addresses
from a table?
|
by: sxwend |
last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query specifies for each record... Essentially this is a make shift Ordering Tool and I want to be able to notify the receiver of the order and its specifics.
q_Order_Detail_4email consists of
,,, and
Example:
Hello@mail.com,956,Modem,1000,xyz123...
|
by: ej20 |
last post by:
I have a php page that pulls email addresses from a MSSQL database. I am trying to insert these addresses into the BCC: Outlook via a link.
my query is as follows:$connect = mssql_connect(SERVER, LOGIN, PASS)
or die("Couldn't connect to SQL Server on SERVER");
$database = mssql_select_db(DBNAME,$connect)
or die("Couldn't open database $DBNAME");
$query = "SELECT Distinct ClcEmail
FROM ClientContact
WHERE Deleted = 0 AND...
|
by: Wayne |
last post by:
I'm using the following code to send email addresses from a query to
Outlook:
Dim db As Database, rs As Recordset, sql As String, emailTo As String
Set db = CurrentDb()
emailTo = ""
sql = "select EmailAdd from qryEmailMerge"
Set rs = db.OpenRecordset(sql)
Do Until rs.EOF
If Not IsNull(rs!EmailAdd) Then
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |