473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Select Statement to GET email address and send mail?

I am trying to add a cmdButton to an Access form. I would like to
click the button, look up an email address in a database table, and
execute Outlook with that email address ready to send an email.

Has anyone tried this?

Code thus far - SELECT fails to fill strSQL variable with the email
address:

Private Sub cmdEmailSend_Click()

Dim Db As Database
Dim strSql As String
Dim txtLName As TextBox

Set Db = CurrentDb()
'Set txtLName = Me.txtLName

strSql = ("SELECT Email" & " FROM Contact" & " WHERE LName = " &
[Forms]![frmReports]![txtLName] & "")

DoCmd.SendObject acSendNoObject, , , strSql, , , , , -1
End Sub

Dec 29 '06 #1
1 1957
I answered this about 3 weeks ago. Have a search, you'll find it.

te********@hotmail.com wrote:
I am trying to add a cmdButton to an Access form. I would like to
click the button, look up an email address in a database table, and
execute Outlook with that email address ready to send an email.

Has anyone tried this?

Code thus far - SELECT fails to fill strSQL variable with the email
address:

Private Sub cmdEmailSend_Click()

Dim Db As Database
Dim strSql As String
Dim txtLName As TextBox

Set Db = CurrentDb()
'Set txtLName = Me.txtLName

strSql = ("SELECT Email" & " FROM Contact" & " WHERE LName = " &
[Forms]![frmReports]![txtLName] & "")

DoCmd.SendObject acSendNoObject, , , strSql, , , , , -1
End Sub
Dec 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: news | last post by:
There's all kinds of ways to validate an email address to make sure it's well formed and whatnot, but what about checking to see if it's a valid e-mail account? Like how you can use checkdnsrr()...
2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
1
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I...
24
by: Arno R | last post by:
Hi all, I have a client with several shoe-shops. Customers can leave their email-address if they want to be notified when there is a sale. Input is validated with instr() I am checking for @...
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
4
by: Ken D. | last post by:
I have an asp page that collects data on referrals. The user inputs the information and selects the rep to receive the referral. My data is being saved to a backend database (SQL) and the user is...
3
by: bpw22az | last post by:
I am currently in the process of setting up an asp page that sends an inquiring student an email regarding his/her application status. The student enters his/her email address on a web page, the...
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.