Solved

Send Database fields displayed in form via an email

Posted on 2013-05-21
1
441 Views
Last Modified: 2013-05-22
I am trying to send data from a database displayed with a form via an email. The database connection is to an MSAccess database.

default.asp - user selects a location and is redirected to
EligibleOrNot.asp. Based on a check in the database, the use is either redirected to:

NotEligible.asp (message displayed with guidelines) OR

Eligible.asp. In addition to the form fields, the user is given some information stored in the database (tblWeb.SSLink) and (tblStaffDirectory.SDFName, tblStaffDirectory.SDLName, tblStaffDirectory.SDEmail). Once the form is complete, the user clicks the submit button. The form data is transferred to Eligible2.asp. The form data is sent to a database AND sent via an email. I have this functioning correctly.

I now need to send the database data (tblStaffDirectory.SDFName, tblStaffDirectory.SDLName, tblStaffDirectory.SDEmail) included in the email.
Eligible.txt
Eligible2.txt
0
Comment
Question by:Malloy1446
1 Comment
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39186607
It looks like you are using the variable ChartID on Eligible.  Just put that as a hidden field in the form (or cookie or session or url).  Then on Eligible2, add back the recordset.
sql = "SELECT tblStaffDirectory.SDLName, tblStaffDirectory.SDFName, " & _
		"tblStaffDirectory.VRContact, tblStaffDirectory.VRAlternate, tblStaffDirectory.SDEmail " & _
		"FROM tblStaffDirectory WHERE ChartID=" & ChartID & ";"

Open in new window

Or you can add the those fields on the Eligible form and read them on Eligible2.  

Now you have multiple ways to get the data to your email script.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question