473,387 Members | 1,536 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,387 software developers and data experts.

Pulling email addresses from a DB, then sending the email

I am working on a form for approval/disapproval of requests. Basically, the user will select a RequestID from a combobox, then select approve or disapprove, then hit the submit button. When they hit submit, I want to

1. Update the DB (which I have already implemented), then
2. using the RequestID, determine the two related email addresses (let's say Email1 and Email2) attached to the relevant ServiceID.

This sounds odd to me, but though I have done a good number of update queries, select queries to populate combo boxes, and a few other things, I haven't had to pull a particular field value from a query individually before and I'm not totally sure where to start.

I have no trouble putting together the actual SQL queries and everything, I'm just not sure how to manipulate the data to pull those two email addresses out individually.
Nov 27 '07 #1
2 1252
JustJim
407 Expert 256MB
I am working on a form for approval/disapproval of requests. Basically, the user will select a RequestID from a combobox, then select approve or disapprove, then hit the submit button. When they hit submit, I want to

1. Update the DB (which I have already implemented), then
2. using the RequestID, determine the two related email addresses (let's say Email1 and Email2) attached to the relevant ServiceID.

This sounds odd to me, but though I have done a good number of update queries, select queries to populate combo boxes, and a few other things, I haven't had to pull a particular field value from a query individually before and I'm not totally sure where to start.

I have no trouble putting together the actual SQL queries and everything, I'm just not sure how to manipulate the data to pull those two email addresses out individually.
Hi,
So your SQL would be something like
Expand|Select|Wrap|Line Numbers
  1. SELECT ServiceTable.Email1, ServiceTable.Email2
  2. FROM RequestTable INNER JOIN ServiceTable ON RequestTable.RequestID = ServiceTable.ServiceTableForeignKey
  3. WHERE RequestTable.RequestID = <the combo-box selection>
and you open a recordset (rs) based on that SQL

You then reference the Email addresses by
rs!Email1 and rs!Email2

And the bit you didn't ask, but is obvious from the title, you then use the SendObject method of the DoCmd object (watch the second-last option of the SendObject method, Edit or not edit, some network security settings get scared if you try to send email programatically without opening the email client.

Good luck and ask again if you need.

Jim
Nov 28 '07 #2
Got it, thanks. I actually figured out a somewhat ridiculous workaround, but your way is better.

And I didn't mention about the SendObject method because I already had that part figured out. ; )
Nov 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
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 @...
7
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
5
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
1
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...
6
by: =?Utf-8?B?RGF2aWQsIHRoZSBncmVhdA==?= | last post by:
Hi, Is there a way to validate an email address and to check whether it is sendable? Function EmailTo(ToEmail, FromEmail, strSubject, strBody) Set objMessage = CreateObject("CDO.Message")...
3
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this:...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.