Solved

Send Database fields displayed in form via an email

Posted on 2013-05-21
1
408 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now