Generate email when I click button?

Generate email when I click button?

am 11.10.2007 22:05:21 von u37541

When I click "save" after adding a new record (which contains, among other
fields, the person's email address), I want an email to automatically be sent
to that person (at the email that is in the field of that record). How can I
do this?

Thanks so much, it really means so much to me!!!

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 11.10.2007 23:12:46 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:798bc3f05f9b3@uwe...
> When I click "save" after adding a new record (which contains, among other
> fields, the person's email address), I want an email to automatically be
sent
> to that person (at the email that is in the field of that record). How can
I
> do this?

What does your Web host support?
Perhaps, CDO.Message or ASPMail.

Re: Generate email when I click button?

am 11.10.2007 23:59:10 von u37541

First off, thank you SO much for responding - it mean's a lot to me - i've
been trying to get this done forever.

So I have godaddy.com. When I look up what they support, I get the following:


CDO.MESSAGE
CDONTS.NewMail

I'm assuming that means that godaddy.com supports CDO.Message.

Thank you so so so so so much again. My heart skipped a beat when I saw that
somebody had finally [at least tried] to answer my cries for help.

Tim


McKirahan wrote:
>> When I click "save" after adding a new record (which contains, among other
>> fields, the person's email address), I want an email to automatically be sent
>> to that person (at the email that is in the field of that record). How can I
>> do this?
>
>What does your Web host support?
>Perhaps, CDO.Message or ASPMail.

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 12.10.2007 01:08:07 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:798cc27bb482e@uwe...
> First off, thank you SO much for responding - it mean's a lot to me - i've
> been trying to get this done forever.
>
> So I have godaddy.com. When I look up what they support, I get the
following:
>
>
> CDO.MESSAGE
> CDONTS.NewMail
>
> I'm assuming that means that godaddy.com supports CDO.Message.

[snip]

Try this; watch for word-wrap.

The Response.Write() statement invokes the function;
modify it to suit your needs. Just call the function by
passing in 3 parms: email address, subject, and body.

The value of "cHST" (Host) is what GoDaddy requires.
The value of "cFRM" (From) is your email address.

Suucess/failure reporting has been commented out as
you may want to log the results rather than display them.

<%@ Language="VBScript" %>
<% Option Explicit

Response.Write("Email = " & Email("news@mckirahan.com","Test","Test!"))

Function Email(sAddr,sSubj,sBody)
Email = False
On Error Resume Next
'*
'* Declare Constants
'*
Const cCDO = "http://schemas.microsoft.com/cdo/configuration/"
Const cHST = "relay-hosting.secureserver.net"
Const cFRM = "postmaster@{your~domain.com}"
'*
'* Send Email
'*
Dim objCFG
Set objCFG = Server.CreateObject("CDO.Configuration")
objCFG.Fields.Item(cCDO & "sendusing") = 2
objCFG.Fields.Item(cCDO & "smtpserver") = cHST
objCFG.Fields.Item(cCDO & "smtpserverport") = 25
objCFG.Fields.Update
Dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")
objCDO.From = cFRM
objCDO.To = sAddr
'objCDO.BCC = ""
'objCDO.CC = ""
objCDO.Subject = sSubj
objCDO.TextBody = sBody
'objCDO.HTMLBody = sBody
'objCDO.AddAttachment = ""
objCDO.Configuration = objCFG
objCDO.Send
' If Err = 0 Then
' Response.Write("

E-mail has been sent.")
' Else
' Response.Write("
Sub Email()")
' Response.Write("
CDO Failed: " & Err.Description)
' Response.Write("
CDO 'Addr': " & sAddr)
' Response.Write("
CDO 'Subj': " & sSubj)
' Response.Write("
CDO 'Body': " & sBody)
' End If
Set objCDO = Nothing
Set objCFG = Nothing
'*
'* Return
'*
On Error GoTo 0
Email = True
End Function
%>

Re: Generate email when I click button?

am 12.10.2007 01:12:12 von u37541

McKirahan,

Before I do this, where do I put all of this text? That has been one of the
things that is unclear to me. Do I put it next to the like where the save-
button is in the html, or what? Thanks so much again!

McKirahan wrote:
>> First off, thank you SO much for responding - it mean's a lot to me - i've
>> been trying to get this done forever.
>[quoted text clipped - 5 lines]
>>
>> I'm assuming that means that godaddy.com supports CDO.Message.
>
>[snip]
>
>Try this; watch for word-wrap.
>
>The Response.Write() statement invokes the function;
>modify it to suit your needs. Just call the function by
>passing in 3 parms: email address, subject, and body.
>
>The value of "cHST" (Host) is what GoDaddy requires.
>The value of "cFRM" (From) is your email address.
>
>Suucess/failure reporting has been commented out as
>you may want to log the results rather than display them.
>
><%@ Language="VBScript" %>
><% Option Explicit
>
>Response.Write("Email = " & Email("news@mckirahan.com","Test","Test!"))
>
>Function Email(sAddr,sSubj,sBody)
> Email = False
> On Error Resume Next
> '*
> '* Declare Constants
> '*
> Const cCDO = "http://schemas.microsoft.com/cdo/configuration/"
> Const cHST = "relay-hosting.secureserver.net"
> Const cFRM = "postmaster@{your~domain.com}"
> '*
> '* Send Email
> '*
> Dim objCFG
> Set objCFG = Server.CreateObject("CDO.Configuration")
> objCFG.Fields.Item(cCDO & "sendusing") = 2
> objCFG.Fields.Item(cCDO & "smtpserver") = cHST
> objCFG.Fields.Item(cCDO & "smtpserverport") = 25
> objCFG.Fields.Update
> Dim objCDO
> Set objCDO = Server.CreateObject("CDO.Message")
> objCDO.From = cFRM
> objCDO.To = sAddr
> 'objCDO.BCC = ""
> 'objCDO.CC = ""
> objCDO.Subject = sSubj
> objCDO.TextBody = sBody
> 'objCDO.HTMLBody = sBody
> 'objCDO.AddAttachment = ""
> objCDO.Configuration = objCFG
> objCDO.Send
>' If Err = 0 Then
>' Response.Write("

E-mail has been sent.")
>' Else
>' Response.Write("
Sub Email()")
>' Response.Write("
CDO Failed: " & Err.Description)
>' Response.Write("
CDO 'Addr': " & sAddr)
>' Response.Write("
CDO 'Subj': " & sSubj)
>' Response.Write("
CDO 'Body': " & sBody)
>' End If
> Set objCDO = Nothing
> Set objCFG = Nothing
> '*
> '* Return
> '*
> On Error GoTo 0
> Email = True
>End Function
>%>

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 12.10.2007 01:15:24 von u37541

Here is the area of html around the save button (plus some more)...where
would i put the part you gave me into this? Thanks so much again!!!


SPID


{build_edit_control field="SPID" mode="add" value=
$value_SPID}

colSpan=2>

value="added">





- Required field
{include_if_exists file="include/footer.asp"} {
$linkdata}


McKirahan wrote:
>> First off, thank you SO much for responding - it mean's a lot to me - i've
>> been trying to get this done forever.
>[quoted text clipped - 5 lines]
>>
>> I'm assuming that means that godaddy.com supports CDO.Message.
>
>[snip]
>
>Try this; watch for word-wrap.
>
>The Response.Write() statement invokes the function;
>modify it to suit your needs. Just call the function by
>passing in 3 parms: email address, subject, and body.
>
>The value of "cHST" (Host) is what GoDaddy requires.
>The value of "cFRM" (From) is your email address.
>
>Suucess/failure reporting has been commented out as
>you may want to log the results rather than display them.
>
><%@ Language="VBScript" %>
><% Option Explicit
>
>Response.Write("Email = " & Email("news@mckirahan.com","Test","Test!"))
>
>Function Email(sAddr,sSubj,sBody)
> Email = False
> On Error Resume Next
> '*
> '* Declare Constants
> '*
> Const cCDO = "http://schemas.microsoft.com/cdo/configuration/"
> Const cHST = "relay-hosting.secureserver.net"
> Const cFRM = "postmaster@{your~domain.com}"
> '*
> '* Send Email
> '*
> Dim objCFG
> Set objCFG = Server.CreateObject("CDO.Configuration")
> objCFG.Fields.Item(cCDO & "sendusing") = 2
> objCFG.Fields.Item(cCDO & "smtpserver") = cHST
> objCFG.Fields.Item(cCDO & "smtpserverport") = 25
> objCFG.Fields.Update
> Dim objCDO
> Set objCDO = Server.CreateObject("CDO.Message")
> objCDO.From = cFRM
> objCDO.To = sAddr
> 'objCDO.BCC = ""
> 'objCDO.CC = ""
> objCDO.Subject = sSubj
> objCDO.TextBody = sBody
> 'objCDO.HTMLBody = sBody
> 'objCDO.AddAttachment = ""
> objCDO.Configuration = objCFG
> objCDO.Send
>' If Err = 0 Then
>' Response.Write("

E-mail has been sent.")
>' Else
>' Response.Write("
Sub Email()")
>' Response.Write("
CDO Failed: " & Err.Description)
>' Response.Write("
CDO 'Addr': " & sAddr)
>' Response.Write("
CDO 'Subj': " & sSubj)
>' Response.Write("
CDO 'Body': " & sBody)
>' End If
> Set objCDO = Nothing
> Set objCFG = Nothing
> '*
> '* Return
> '*
> On Error GoTo 0
> Email = True
>End Function
>%>

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 12.10.2007 04:47:11 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:798d6cf71f578@uwe...
> Here is the area of html around the save button (plus some more)...where
> would i put the part you gave me into this? Thanks so much again!!!
>
>
>

SPID


> {build_edit_control field="SPID" mode="add" value=
> $value_SPID}
>
> > colSpan=2> name=submit1>
>
> > value="added">
>
>
>

>
- Required field
> {include_if_exists file="include/footer.asp"} {
> $linkdata}

Where's your ASP code?

Re: Generate email when I click button?

am 12.10.2007 04:47:14 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:798d65d0832f8@uwe...
> McKirahan,
>
> Before I do this, where do I put all of this text? That has been one of
the
> things that is unclear to me. Do I put it next to the like where the save-
> button is in the html, or what? Thanks so much again!

[snip]

You're original post included the following statement:
>When I click "save" after adding a new record ...

What is the ASP logic behind your save button.

After the "save" call the "Email()" function.
You do know something about ASP don't you?
All ASP code is between <% and %> tags unless it's "included".

Re: Generate email when I click button?

am 12.10.2007 04:53:54 von u37541

Sorry about that, here is the asp for that "Add doctor" page: Thank you again!







<%
Set myRequest = CreateObject("Scripting.Dictionary")
Set myRequestFiles = CreateObject("Scripting.Dictionary")
if ParseMultiPartForm()=true then parse=1
MaxSizeSet=false


'// check if logged in
if SESSION("UserID")="" or not CheckSecurity(SESSION("_" & strTableName &
"_OwnerID"),"Add") then
SESSION("MyURL")=request.ServerVariables("SCRIPT_NAME")&"?"& request.
ServerVariables("QUERY_STRING")
response.Redirect "login.asp?message=expired"
response.End
end if

filename=""
message=""
readavalues=false
errorhappened=false

'//connect database
dbConnection=""
db_connect()
Set rs = server.CreateObject("ADODB.Recordset")

'// insert new record if we have to

if getRequestForm("a")="added" then
set afilename_values = CreateObject("Scripting.Dictionary")
set avalues = CreateObject("Scripting.Dictionary")
set files_move = CreateObject("Scripting.Dictionary")

dim toadd
dim thumb
'// processing LastName - start

value = postvalue("value_LastName")
ttype=postvalue("type_LastName")
toadd=true
if myRequest.Exists("value_LastName") or myRequest.Exists("value_LastName[]")
or myRequest.Exists("type_LastName") then

value=prepare_for_db("LastName",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("LastName")=value
end if

end if


' processibng LastName - end
'// processing FirstName - start

value = postvalue("value_FirstName")
ttype=postvalue("type_FirstName")
toadd=true
if myRequest.Exists("value_FirstName") or myRequest.Exists("value_FirstName[]
") or myRequest.Exists("type_FirstName") then

value=prepare_for_db("FirstName",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("FirstName")=value
end if

end if


' processibng FirstName - end
'// processing Phone - start

value = postvalue("value_Phone")
ttype=postvalue("type_Phone")
toadd=true
if myRequest.Exists("value_Phone") or myRequest.Exists("value_Phone[]") or
myRequest.Exists("type_Phone") then

value=prepare_for_db("Phone",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("Phone")=value
end if

end if


' processibng Phone - end
'// processing Email - start

value = postvalue("value_Email")
ttype=postvalue("type_Email")
toadd=true
if myRequest.Exists("value_Email") or myRequest.Exists("value_Email[]") or
myRequest.Exists("type_Email") then

value=prepare_for_db("Email",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("Email")=value
end if

end if


' processibng Email - end
'// processing Specialty - start

value = postvalue("value_Specialty")
ttype=postvalue("type_Specialty")
toadd=true
if myRequest.Exists("value_Specialty") or myRequest.Exists("value_Specialty[]
") or myRequest.Exists("type_Specialty") then

value=prepare_for_db("Specialty",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("Specialty")=value
end if

end if


' processibng Specialty - end
'// processing WaitingRoom - start

value = postvalue("value_WaitingRoom")
ttype=postvalue("type_WaitingRoom")
toadd=true
if myRequest.Exists("value_WaitingRoom") or myRequest.Exists
("value_WaitingRoom[]") or myRequest.Exists("type_WaitingRoom") then

value=prepare_for_db("WaitingRoom",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("WaitingRoom")=value
end if

end if


' processibng WaitingRoom - end
'// processing ConsentSent - start

value = postvalue("value_ConsentSent")
ttype=postvalue("type_ConsentSent")
toadd=true
if myRequest.Exists("value_ConsentSent") or myRequest.Exists
("value_ConsentSent[]") or myRequest.Exists("type_ConsentSent") then

value=prepare_for_db("ConsentSent",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSent")=value
end if

end if


' processibng ConsentSent - end
'// processing ConsentSentVia-1 - start

value = postvalue("value_ConsentSentVia_1")
ttype=postvalue("type_ConsentSentVia_1")
toadd=true
if myRequest.Exists("value_ConsentSentVia_1") or myRequest.Exists
("value_ConsentSentVia_1[]") or myRequest.Exists("type_ConsentSentVia_1")
then

value=prepare_for_db("ConsentSentVia-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentVia-1")=value
end if

end if


' processibng ConsentSentVia-1 - end
'// processing ConsentSentDate-1 - start

value = postvalue("value_ConsentSentDate_1")
ttype=postvalue("type_ConsentSentDate_1")
toadd=true
if myRequest.Exists("value_ConsentSentDate_1") or myRequest.Exists
("value_ConsentSentDate_1[]") or myRequest.Exists("type_ConsentSentDate_1")
then

value=prepare_for_db("ConsentSentDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentDate-1")=value
end if

end if


' processibng ConsentSentDate-1 - end
'// processing ConsentSent2 - start

value = postvalue("value_ConsentSent2")
ttype=postvalue("type_ConsentSent2")
toadd=true
if myRequest.Exists("value_ConsentSent2") or myRequest.Exists
("value_ConsentSent2[]") or myRequest.Exists("type_ConsentSent2") then

value=prepare_for_db("ConsentSent2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSent2")=value
end if

end if


' processibng ConsentSent2 - end
'// processing ConsentSentVia-2 - start

value = postvalue("value_ConsentSentVia_2")
ttype=postvalue("type_ConsentSentVia_2")
toadd=true
if myRequest.Exists("value_ConsentSentVia_2") or myRequest.Exists
("value_ConsentSentVia_2[]") or myRequest.Exists("type_ConsentSentVia_2")
then

value=prepare_for_db("ConsentSentVia-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentVia-2")=value
end if

end if


' processibng ConsentSentVia-2 - end
'// processing ConsentSentDate-2 - start

value = postvalue("value_ConsentSentDate_2")
ttype=postvalue("type_ConsentSentDate_2")
toadd=true
if myRequest.Exists("value_ConsentSentDate_2") or myRequest.Exists
("value_ConsentSentDate_2[]") or myRequest.Exists("type_ConsentSentDate_2")
then

value=prepare_for_db("ConsentSentDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentDate-2")=value
end if

end if


' processibng ConsentSentDate-2 - end
'// processing ConsentSent3 - start

value = postvalue("value_ConsentSent3")
ttype=postvalue("type_ConsentSent3")
toadd=true
if myRequest.Exists("value_ConsentSent3") or myRequest.Exists
("value_ConsentSent3[]") or myRequest.Exists("type_ConsentSent3") then

value=prepare_for_db("ConsentSent3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSent3")=value
end if

end if


' processibng ConsentSent3 - end
'// processing ConsentSentVia-3 - start

value = postvalue("value_ConsentSentVia_3")
ttype=postvalue("type_ConsentSentVia_3")
toadd=true
if myRequest.Exists("value_ConsentSentVia_3") or myRequest.Exists
("value_ConsentSentVia_3[]") or myRequest.Exists("type_ConsentSentVia_3")
then

value=prepare_for_db("ConsentSentVia-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentVia-3")=value
end if

end if


' processibng ConsentSentVia-3 - end
'// processing ConsentSentDate-3 - start

value = postvalue("value_ConsentSentDate_3")
ttype=postvalue("type_ConsentSentDate_3")
toadd=true
if myRequest.Exists("value_ConsentSentDate_3") or myRequest.Exists
("value_ConsentSentDate_3[]") or myRequest.Exists("type_ConsentSentDate_3")
then

value=prepare_for_db("ConsentSentDate-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentSentDate-3")=value
end if

end if


' processibng ConsentSentDate-3 - end
'// processing ConsentReturned - start

value = postvalue("value_ConsentReturned")
ttype=postvalue("type_ConsentReturned")
toadd=true
if myRequest.Exists("value_ConsentReturned") or myRequest.Exists
("value_ConsentReturned[]") or myRequest.Exists("type_ConsentReturned") then

value=prepare_for_db("ConsentReturned",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentReturned")=value
end if

end if


' processibng ConsentReturned - end
'// processing ConsentReturnedVia - start

value = postvalue("value_ConsentReturnedVia")
ttype=postvalue("type_ConsentReturnedVia")
toadd=true
if myRequest.Exists("value_ConsentReturnedVia") or myRequest.Exists
("value_ConsentReturnedVia[]") or myRequest.Exists("type_ConsentReturnedVia")
then

value=prepare_for_db("ConsentReturnedVia",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentReturnedVia")=value
end if

end if


' processibng ConsentReturnedVia - end
'// processing ConsentReturnedDate - start

value = postvalue("value_ConsentReturnedDate")
ttype=postvalue("type_ConsentReturnedDate")
toadd=true
if myRequest.Exists("value_ConsentReturnedDate") or myRequest.Exists
("value_ConsentReturnedDate[]") or myRequest.Exists
("type_ConsentReturnedDate") then

value=prepare_for_db("ConsentReturnedDate",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ConsentReturnedDate")=value
end if

end if


' processibng ConsentReturnedDate - end
'// processing QaireEmailed - start

value = postvalue("value_QaireEmailed")
ttype=postvalue("type_QaireEmailed")
toadd=true
if myRequest.Exists("value_QaireEmailed") or myRequest.Exists
("value_QaireEmailed[]") or myRequest.Exists("type_QaireEmailed") then

value=prepare_for_db("QaireEmailed",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireEmailed")=value
end if

end if


' processibng QaireEmailed - end
'// processing QaireEmailDate - start

value = postvalue("value_QaireEmailDate")
ttype=postvalue("type_QaireEmailDate")
toadd=true
if myRequest.Exists("value_QaireEmailDate") or myRequest.Exists
("value_QaireEmailDate[]") or myRequest.Exists("type_QaireEmailDate") then

value=prepare_for_db("QaireEmailDate",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireEmailDate")=value
end if

end if


' processibng QaireEmailDate - end
'// processing QaireEmailed2 - start

value = postvalue("value_QaireEmailed2")
ttype=postvalue("type_QaireEmailed2")
toadd=true
if myRequest.Exists("value_QaireEmailed2") or myRequest.Exists
("value_QaireEmailed2[]") or myRequest.Exists("type_QaireEmailed2") then

value=prepare_for_db("QaireEmailed2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireEmailed2")=value
end if

end if


' processibng QaireEmailed2 - end
'// processing QaireEmailDate2 - start

value = postvalue("value_QaireEmailDate2")
ttype=postvalue("type_QaireEmailDate2")
toadd=true
if myRequest.Exists("value_QaireEmailDate2") or myRequest.Exists
("value_QaireEmailDate2[]") or myRequest.Exists("type_QaireEmailDate2") then

value=prepare_for_db("QaireEmailDate2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireEmailDate2")=value
end if

end if


' processibng QaireEmailDate2 - end
'// processing QaireCompleted - start

value = postvalue("value_QaireCompleted")
ttype=postvalue("type_QaireCompleted")
toadd=true
if myRequest.Exists("value_QaireCompleted") or myRequest.Exists
("value_QaireCompleted[]") or myRequest.Exists("type_QaireCompleted") then

value=prepare_for_db("QaireCompleted",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireCompleted")=value
end if

end if


' processibng QaireCompleted - end
'// processing QaireCompleteDate - start

value = postvalue("value_QaireCompleteDate")
ttype=postvalue("type_QaireCompleteDate")
toadd=true
if myRequest.Exists("value_QaireCompleteDate") or myRequest.Exists
("value_QaireCompleteDate[]") or myRequest.Exists("type_QaireCompleteDate")
then

value=prepare_for_db("QaireCompleteDate",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("QaireCompleteDate")=value
end if

end if


' processibng QaireCompleteDate - end
'// processing PtListPulled1 - start

value = postvalue("value_PtListPulled1")
ttype=postvalue("type_PtListPulled1")
toadd=true
if myRequest.Exists("value_PtListPulled1") or myRequest.Exists
("value_PtListPulled1[]") or myRequest.Exists("type_PtListPulled1") then

value=prepare_for_db("PtListPulled1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListPulled1")=value
end if

end if


' processibng PtListPulled1 - end
'// processing PtListN-1 - start

value = postvalue("value_PtListN_1")
ttype=postvalue("type_PtListN_1")
toadd=true
if myRequest.Exists("value_PtListN_1") or myRequest.Exists("value_PtListN_1[]
") or myRequest.Exists("type_PtListN_1") then

value=prepare_for_db("PtListN-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListN-1")=value
end if

end if


' processibng PtListN-1 - end
'// processing PtListSent - start

value = postvalue("value_PtListSent")
ttype=postvalue("type_PtListSent")
toadd=true
if myRequest.Exists("value_PtListSent") or myRequest.Exists("value_PtListSent
[]") or myRequest.Exists("type_PtListSent") then

value=prepare_for_db("PtListSent",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListSent")=value
end if

end if


' processibng PtListSent - end
'// processing PtListSentDate-1 - start

value = postvalue("value_PtListSentDate_1")
ttype=postvalue("type_PtListSentDate_1")
toadd=true
if myRequest.Exists("value_PtListSentDate_1") or myRequest.Exists
("value_PtListSentDate_1[]") or myRequest.Exists("type_PtListSentDate_1")
then

value=prepare_for_db("PtListSentDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListSentDate-1")=value
end if

end if


' processibng PtListSentDate-1 - end
'// processing PtListRemindSent - start

value = postvalue("value_PtListRemindSent")
ttype=postvalue("type_PtListRemindSent")
toadd=true
if myRequest.Exists("value_PtListRemindSent") or myRequest.Exists
("value_PtListRemindSent[]") or myRequest.Exists("type_PtListRemindSent")
then

value=prepare_for_db("PtListRemindSent",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindSent")=value
end if

end if


' processibng PtListRemindSent - end
'// processing PtListRemindVia - start

value = postvalue("value_PtListRemindVia")
ttype=postvalue("type_PtListRemindVia")
toadd=true
if myRequest.Exists("value_PtListRemindVia") or myRequest.Exists
("value_PtListRemindVia[]") or myRequest.Exists("type_PtListRemindVia") then

value=prepare_for_db("PtListRemindVia",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindVia")=value
end if

end if


' processibng PtListRemindVia - end
'// processing PtListRemindDate-1 - start

value = postvalue("value_PtListRemindDate_1")
ttype=postvalue("type_PtListRemindDate_1")
toadd=true
if myRequest.Exists("value_PtListRemindDate_1") or myRequest.Exists
("value_PtListRemindDate_1[]") or myRequest.Exists("type_PtListRemindDate_1")
then

value=prepare_for_db("PtListRemindDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindDate-1")=value
end if

end if


' processibng PtListRemindDate-1 - end
'// processing PtListReturned - start

value = postvalue("value_PtListReturned")
ttype=postvalue("type_PtListReturned")
toadd=true
if myRequest.Exists("value_PtListReturned") or myRequest.Exists
("value_PtListReturned[]") or myRequest.Exists("type_PtListReturned") then

value=prepare_for_db("PtListReturned",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListReturned")=value
end if

end if


' processibng PtListReturned - end
'// processing PtListReturnDate-1 - start

value = postvalue("value_PtListReturnDate_1")
ttype=postvalue("type_PtListReturnDate_1")
toadd=true
if myRequest.Exists("value_PtListReturnDate_1") or myRequest.Exists
("value_PtListReturnDate_1[]") or myRequest.Exists("type_PtListReturnDate_1")
then

value=prepare_for_db("PtListReturnDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListReturnDate-1")=value
end if

end if


' processibng PtListReturnDate-1 - end
'// processing PtLetterMailed - start

value = postvalue("value_PtLetterMailed")
ttype=postvalue("type_PtLetterMailed")
toadd=true
if myRequest.Exists("value_PtLetterMailed") or myRequest.Exists
("value_PtLetterMailed[]") or myRequest.Exists("type_PtLetterMailed") then

value=prepare_for_db("PtLetterMailed",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtLetterMailed")=value
end if

end if


' processibng PtLetterMailed - end
'// processing PtLetterMailDate-1 - start

value = postvalue("value_PtLetterMailDate_1")
ttype=postvalue("type_PtLetterMailDate_1")
toadd=true
if myRequest.Exists("value_PtLetterMailDate_1") or myRequest.Exists
("value_PtLetterMailDate_1[]") or myRequest.Exists("type_PtLetterMailDate_1")
then

value=prepare_for_db("PtLetterMailDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtLetterMailDate-1")=value
end if

end if


' processibng PtLetterMailDate-1 - end
'// processing PtListSentDate-2 - start

value = postvalue("value_PtListSentDate_2")
ttype=postvalue("type_PtListSentDate_2")
toadd=true
if myRequest.Exists("value_PtListSentDate_2") or myRequest.Exists
("value_PtListSentDate_2[]") or myRequest.Exists("type_PtListSentDate_2")
then

value=prepare_for_db("PtListSentDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListSentDate-2")=value
end if

end if


' processibng PtListSentDate-2 - end
'// processing PtListRemindVia-2 - start

value = postvalue("value_PtListRemindVia_2")
ttype=postvalue("type_PtListRemindVia_2")
toadd=true
if myRequest.Exists("value_PtListRemindVia_2") or myRequest.Exists
("value_PtListRemindVia_2[]") or myRequest.Exists("type_PtListRemindVia_2")
then

value=prepare_for_db("PtListRemindVia-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindVia-2")=value
end if

end if


' processibng PtListRemindVia-2 - end
'// processing PtListRemindDate-2 - start

value = postvalue("value_PtListRemindDate_2")
ttype=postvalue("type_PtListRemindDate_2")
toadd=true
if myRequest.Exists("value_PtListRemindDate_2") or myRequest.Exists
("value_PtListRemindDate_2[]") or myRequest.Exists("type_PtListRemindDate_2")
then

value=prepare_for_db("PtListRemindDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindDate-2")=value
end if

end if


' processibng PtListRemindDate-2 - end
'// processing PtListReturnDate-2 - start

value = postvalue("value_PtListReturnDate_2")
ttype=postvalue("type_PtListReturnDate_2")
toadd=true
if myRequest.Exists("value_PtListReturnDate_2") or myRequest.Exists
("value_PtListReturnDate_2[]") or myRequest.Exists("type_PtListReturnDate_2")
then

value=prepare_for_db("PtListReturnDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListReturnDate-2")=value
end if

end if


' processibng PtListReturnDate-2 - end
'// processing PtLetterMailDate-2 - start

value = postvalue("value_PtLetterMailDate_2")
ttype=postvalue("type_PtLetterMailDate_2")
toadd=true
if myRequest.Exists("value_PtLetterMailDate_2") or myRequest.Exists
("value_PtLetterMailDate_2[]") or myRequest.Exists("type_PtLetterMailDate_2")
then

value=prepare_for_db("PtLetterMailDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtLetterMailDate-2")=value
end if

end if


' processibng PtLetterMailDate-2 - end
'// processing PtListSentDate-3 - start

value = postvalue("value_PtListSentDate_3")
ttype=postvalue("type_PtListSentDate_3")
toadd=true
if myRequest.Exists("value_PtListSentDate_3") or myRequest.Exists
("value_PtListSentDate_3[]") or myRequest.Exists("type_PtListSentDate_3")
then

value=prepare_for_db("PtListSentDate-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListSentDate-3")=value
end if

end if


' processibng PtListSentDate-3 - end
'// processing PtListRemindVia-3 - start

value = postvalue("value_PtListRemindVia_3")
ttype=postvalue("type_PtListRemindVia_3")
toadd=true
if myRequest.Exists("value_PtListRemindVia_3") or myRequest.Exists
("value_PtListRemindVia_3[]") or myRequest.Exists("type_PtListRemindVia_3")
then

value=prepare_for_db("PtListRemindVia-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindVia-3")=value
end if

end if


' processibng PtListRemindVia-3 - end
'// processing PtListRemindDate-3 - start

value = postvalue("value_PtListRemindDate_3")
ttype=postvalue("type_PtListRemindDate_3")
toadd=true
if myRequest.Exists("value_PtListRemindDate_3") or myRequest.Exists
("value_PtListRemindDate_3[]") or myRequest.Exists("type_PtListRemindDate_3")
then

value=prepare_for_db("PtListRemindDate-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListRemindDate-3")=value
end if

end if


' processibng PtListRemindDate-3 - end
'// processing PtListReturnDate-3 - start

value = postvalue("value_PtListReturnDate_3")
ttype=postvalue("type_PtListReturnDate_3")
toadd=true
if myRequest.Exists("value_PtListReturnDate_3") or myRequest.Exists
("value_PtListReturnDate_3[]") or myRequest.Exists("type_PtListReturnDate_3")
then

value=prepare_for_db("PtListReturnDate-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtListReturnDate-3")=value
end if

end if


' processibng PtListReturnDate-3 - end
'// processing PtLetterMailDate-3 - start

value = postvalue("value_PtLetterMailDate_3")
ttype=postvalue("type_PtLetterMailDate_3")
toadd=true
if myRequest.Exists("value_PtLetterMailDate_3") or myRequest.Exists
("value_PtLetterMailDate_3[]") or myRequest.Exists("type_PtLetterMailDate_3")
then

value=prepare_for_db("PtLetterMailDate-3",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PtLetterMailDate-3")=value
end if

end if


' processibng PtLetterMailDate-3 - end
'// processing EdocInviteSent - start

value = postvalue("value_EdocInviteSent")
ttype=postvalue("type_EdocInviteSent")
toadd=true
if myRequest.Exists("value_EdocInviteSent") or myRequest.Exists
("value_EdocInviteSent[]") or myRequest.Exists("type_EdocInviteSent") then

value=prepare_for_db("EdocInviteSent",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("EdocInviteSent")=value
end if

end if


' processibng EdocInviteSent - end
'// processing EdocInviteDate-1 - start

value = postvalue("value_EdocInviteDate_1")
ttype=postvalue("type_EdocInviteDate_1")
toadd=true
if myRequest.Exists("value_EdocInviteDate_1") or myRequest.Exists
("value_EdocInviteDate_1[]") or myRequest.Exists("type_EdocInviteDate_1")
then

value=prepare_for_db("EdocInviteDate-1",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("EdocInviteDate-1")=value
end if

end if


' processibng EdocInviteDate-1 - end
'// processing EdocInviteDate-2 - start

value = postvalue("value_EdocInviteDate_2")
ttype=postvalue("type_EdocInviteDate_2")
toadd=true
if myRequest.Exists("value_EdocInviteDate_2") or myRequest.Exists
("value_EdocInviteDate_2[]") or myRequest.Exists("type_EdocInviteDate_2")
then

value=prepare_for_db("EdocInviteDate-2",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("EdocInviteDate-2")=value
end if

end if


' processibng EdocInviteDate-2 - end
'// processing EdocDirectionsSentDate - start

value = postvalue("value_EdocDirectionsSentDate")
ttype=postvalue("type_EdocDirectionsSentDate")
toadd=true
if myRequest.Exists("value_EdocDirectionsSentDate") or myRequest.Exists
("value_EdocDirectionsSentDate[]") or myRequest.Exists
("type_EdocDirectionsSentDate") then

value=prepare_for_db("EdocDirectionsSentDate",value,ttype,"" )

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("EdocDirectionsSentDate")=value
end if

end if


' processibng EdocDirectionsSentDate - end
'// processing PenSent - start

value = postvalue("value_PenSent")
ttype=postvalue("type_PenSent")
toadd=true
if myRequest.Exists("value_PenSent") or myRequest.Exists("value_PenSent[]")
or myRequest.Exists("type_PenSent") then

value=prepare_for_db("PenSent",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PenSent")=value
end if

end if


' processibng PenSent - end
'// processing PenSentDate - start

value = postvalue("value_PenSentDate")
ttype=postvalue("type_PenSentDate")
toadd=true
if myRequest.Exists("value_PenSentDate") or myRequest.Exists
("value_PenSentDate[]") or myRequest.Exists("type_PenSentDate") then

value=prepare_for_db("PenSentDate",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("PenSentDate")=value
end if

end if


' processibng PenSentDate - end
'// processing Withdrawl - start

value = postvalue("value_Withdrawl")
ttype=postvalue("type_Withdrawl")
toadd=true
if myRequest.Exists("value_Withdrawl") or myRequest.Exists("value_Withdrawl[]
") or myRequest.Exists("type_Withdrawl") then

value=prepare_for_db("Withdrawl",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("Withdrawl")=value
end if

end if


' processibng Withdrawl - end
'// processing WithdrawlDate - start

value = postvalue("value_WithdrawlDate")
ttype=postvalue("type_WithdrawlDate")
toadd=true
if myRequest.Exists("value_WithdrawlDate") or myRequest.Exists
("value_WithdrawlDate[]") or myRequest.Exists("type_WithdrawlDate") then

value=prepare_for_db("WithdrawlDate",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("WithdrawlDate")=value
end if

end if


' processibng WithdrawlDate - end
'// processing WithdrawlReason - start

value = postvalue("value_WithdrawlReason")
ttype=postvalue("type_WithdrawlReason")
toadd=true
if myRequest.Exists("value_WithdrawlReason") or myRequest.Exists
("value_WithdrawlReason[]") or myRequest.Exists("type_WithdrawlReason") then

value=prepare_for_db("WithdrawlReason",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("WithdrawlReason")=value
end if

end if


' processibng WithdrawlReason - end
'// processing Notes - start

value = postvalue("value_Notes")
ttype=postvalue("type_Notes")
toadd=true
if myRequest.Exists("value_Notes") or myRequest.Exists("value_Notes[]") or
myRequest.Exists("type_Notes") then

value=prepare_for_db("Notes",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("Notes")=value
end if

end if


' processibng Notes - end
'// processing ClinicID - start

value = postvalue("value_ClinicID")
ttype=postvalue("type_ClinicID")
toadd=true
if myRequest.Exists("value_ClinicID") or myRequest.Exists("value_ClinicID[]")
or myRequest.Exists("type_ClinicID") then

value=prepare_for_db("ClinicID",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("ClinicID")=value
end if

end if


' processibng ClinicID - end
'// processing SPID - start

value = postvalue("value_SPID")
ttype=postvalue("type_SPID")
toadd=true
if myRequest.Exists("value_SPID") or myRequest.Exists("value_SPID[]") or
myRequest.Exists("type_SPID") then

value=prepare_for_db("SPID",value,ttype,"")

if vartype(value)=11 then
if value=false then toadd=false
end if
if toadd then
avalues("SPID")=value
end if

end if


' processibng SPID - end





'// add filenames to values
for each akey in afilename_values
avalues(akey)=afilename_values(akey)
next

'// before Add event
retval = true
DoEvent "retval = BeforeAdd(avalues)"

if retval then

on error resume next
rs.Open "select * from " & AddTableWrappers(strOriginalTableName) & " where
1=0", dbConnection, 1,2
rs.Addnew
call report_error
if IsUpdatable(rs("DoctorID")) then
' insert DoctorID field
strValue=false
if avalues.exists("DoctorID") then _
strValue = avalues.Item("DoctorID")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_DoctorID")
if strValue<>"" and IsNumeric(strValue) then
rs("DoctorID") = CLng(strValue)
else
rs("DoctorID") = null
end if
call report_error
end if
end if
' insert LastName field
strValue=false
if avalues.exists("LastName") then _
strValue = avalues.Item("LastName")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_LastName")
rs("LastName") = strValue
call report_error
end if
' insert FirstName field
strValue=false
if avalues.exists("FirstName") then _
strValue = avalues.Item("FirstName")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_FirstName")
rs("FirstName") = strValue
call report_error
end if
' insert Phone field
strValue=false
if avalues.exists("Phone") then _
strValue = avalues.Item("Phone")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Phone")
rs("Phone") = strValue
call report_error
end if
' insert Email field
strValue=false
if avalues.exists("Email") then _
strValue = avalues.Item("Email")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Email")
rs("Email") = strValue
call report_error
end if
' insert Specialty field
strValue=false
if avalues.exists("Specialty") then _
strValue = avalues.Item("Specialty")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Specialty")
rs("Specialty") = strValue
call report_error
end if
' insert WaitingRoom field
strValue=false
if avalues.exists("WaitingRoom") then _
strValue = avalues.Item("WaitingRoom")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_WaitingRoom")
rs("WaitingRoom") = strValue
call report_error
end if
' insert ConsentSent field
strValue=false
if avalues.exists("ConsentSent") then _
strValue = avalues.Item("ConsentSent")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSent")
if strValue<>"" and IsNumeric(strValue) then
rs("ConsentSent") = CLng(strValue)
else
rs("ConsentSent") = null
end if
call report_error
end if
' insert ConsentSentVia-1 field
strValue=false
if avalues.exists("ConsentSentVia-1") then _
strValue = avalues.Item("ConsentSentVia-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentVia_1")
rs("ConsentSentVia-1") = strValue
call report_error
end if
' insert ConsentSentDate-1 field
strValue=false
if avalues.exists("ConsentSentDate-1") then _
strValue = avalues.Item("ConsentSentDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentDate_1")
if strValue="" then
rs("ConsentSentDate-1")=null
else
rs("ConsentSentDate-1")=strValue
end if
call report_error
end if
' insert ConsentSent2 field
strValue=false
if avalues.exists("ConsentSent2") then _
strValue = avalues.Item("ConsentSent2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSent2")
if strValue<>"" and IsNumeric(strValue) then
rs("ConsentSent2") = CLng(strValue)
else
rs("ConsentSent2") = null
end if
call report_error
end if
' insert ConsentSentVia-2 field
strValue=false
if avalues.exists("ConsentSentVia-2") then _
strValue = avalues.Item("ConsentSentVia-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentVia_2")
rs("ConsentSentVia-2") = strValue
call report_error
end if
' insert ConsentSentDate-2 field
strValue=false
if avalues.exists("ConsentSentDate-2") then _
strValue = avalues.Item("ConsentSentDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentDate_2")
if strValue="" then
rs("ConsentSentDate-2")=null
else
rs("ConsentSentDate-2")=strValue
end if
call report_error
end if
' insert ConsentSent3 field
strValue=false
if avalues.exists("ConsentSent3") then _
strValue = avalues.Item("ConsentSent3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSent3")
if strValue<>"" and IsNumeric(strValue) then
rs("ConsentSent3") = CLng(strValue)
else
rs("ConsentSent3") = null
end if
call report_error
end if
' insert ConsentSentVia-3 field
strValue=false
if avalues.exists("ConsentSentVia-3") then _
strValue = avalues.Item("ConsentSentVia-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentVia_3")
rs("ConsentSentVia-3") = strValue
call report_error
end if
' insert ConsentSentDate-3 field
strValue=false
if avalues.exists("ConsentSentDate-3") then _
strValue = avalues.Item("ConsentSentDate-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentSentDate_3")
rs("ConsentSentDate-3") = strValue
call report_error
end if
' insert ConsentReturned field
strValue=false
if avalues.exists("ConsentReturned") then _
strValue = avalues.Item("ConsentReturned")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentReturned")
if strValue<>"" and IsNumeric(strValue) then
rs("ConsentReturned") = CLng(strValue)
else
rs("ConsentReturned") = null
end if
call report_error
end if
' insert ConsentReturnedVia field
strValue=false
if avalues.exists("ConsentReturnedVia") then _
strValue = avalues.Item("ConsentReturnedVia")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentReturnedVia")
rs("ConsentReturnedVia") = strValue
call report_error
end if
' insert ConsentReturnedDate field
strValue=false
if avalues.exists("ConsentReturnedDate") then _
strValue = avalues.Item("ConsentReturnedDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ConsentReturnedDate")
if strValue="" then
rs("ConsentReturnedDate")=null
else
rs("ConsentReturnedDate")=strValue
end if
call report_error
end if
' insert QaireEmailed field
strValue=false
if avalues.exists("QaireEmailed") then _
strValue = avalues.Item("QaireEmailed")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireEmailed")
if strValue<>"" and IsNumeric(strValue) then
rs("QaireEmailed") = CLng(strValue)
else
rs("QaireEmailed") = null
end if
call report_error
end if
' insert QaireEmailDate field
strValue=false
if avalues.exists("QaireEmailDate") then _
strValue = avalues.Item("QaireEmailDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireEmailDate")
if strValue="" then
rs("QaireEmailDate")=null
else
rs("QaireEmailDate")=strValue
end if
call report_error
end if
' insert QaireEmailed2 field
strValue=false
if avalues.exists("QaireEmailed2") then _
strValue = avalues.Item("QaireEmailed2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireEmailed2")
if strValue<>"" and IsNumeric(strValue) then
rs("QaireEmailed2") = CLng(strValue)
else
rs("QaireEmailed2") = null
end if
call report_error
end if
' insert QaireEmailDate2 field
strValue=false
if avalues.exists("QaireEmailDate2") then _
strValue = avalues.Item("QaireEmailDate2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireEmailDate2")
if strValue="" then
rs("QaireEmailDate2")=null
else
rs("QaireEmailDate2")=strValue
end if
call report_error
end if
' insert QaireCompleted field
strValue=false
if avalues.exists("QaireCompleted") then _
strValue = avalues.Item("QaireCompleted")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireCompleted")
if strValue<>"" and IsNumeric(strValue) then
rs("QaireCompleted") = CLng(strValue)
else
rs("QaireCompleted") = null
end if
call report_error
end if
' insert QaireCompleteDate field
strValue=false
if avalues.exists("QaireCompleteDate") then _
strValue = avalues.Item("QaireCompleteDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_QaireCompleteDate")
if strValue="" then
rs("QaireCompleteDate")=null
else
rs("QaireCompleteDate")=strValue
end if
call report_error
end if
' insert PtListPulled1 field
strValue=false
if avalues.exists("PtListPulled1") then _
strValue = avalues.Item("PtListPulled1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListPulled1")
if strValue<>"" and IsNumeric(strValue) then
rs("PtListPulled1") = CLng(strValue)
else
rs("PtListPulled1") = null
end if
call report_error
end if
' insert PtListN-1 field
strValue=false
if avalues.exists("PtListN-1") then _
strValue = avalues.Item("PtListN-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListN_1")
rs("PtListN-1") = strValue
call report_error
end if
' insert PtListSent field
strValue=false
if avalues.exists("PtListSent") then _
strValue = avalues.Item("PtListSent")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListSent")
if strValue<>"" and IsNumeric(strValue) then
rs("PtListSent") = CLng(strValue)
else
rs("PtListSent") = null
end if
call report_error
end if
' insert PtListSentDate-1 field
strValue=false
if avalues.exists("PtListSentDate-1") then _
strValue = avalues.Item("PtListSentDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListSentDate_1")
if strValue="" then
rs("PtListSentDate-1")=null
else
rs("PtListSentDate-1")=strValue
end if
call report_error
end if
' insert PtListRemindSent field
strValue=false
if avalues.exists("PtListRemindSent") then _
strValue = avalues.Item("PtListRemindSent")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindSent")
if strValue<>"" and IsNumeric(strValue) then
rs("PtListRemindSent") = CLng(strValue)
else
rs("PtListRemindSent") = null
end if
call report_error
end if
' insert PtListRemindVia field
strValue=false
if avalues.exists("PtListRemindVia") then _
strValue = avalues.Item("PtListRemindVia")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindVia")
rs("PtListRemindVia") = strValue
call report_error
end if
' insert PtListRemindDate-1 field
strValue=false
if avalues.exists("PtListRemindDate-1") then _
strValue = avalues.Item("PtListRemindDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindDate_1")
if strValue="" then
rs("PtListRemindDate-1")=null
else
rs("PtListRemindDate-1")=strValue
end if
call report_error
end if
' insert PtListReturned field
strValue=false
if avalues.exists("PtListReturned") then _
strValue = avalues.Item("PtListReturned")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListReturned")
if strValue<>"" and IsNumeric(strValue) then
rs("PtListReturned") = CLng(strValue)
else
rs("PtListReturned") = null
end if
call report_error
end if
' insert PtListReturnDate-1 field
strValue=false
if avalues.exists("PtListReturnDate-1") then _
strValue = avalues.Item("PtListReturnDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListReturnDate_1")
if strValue="" then
rs("PtListReturnDate-1")=null
else
rs("PtListReturnDate-1")=strValue
end if
call report_error
end if
' insert PtLetterMailed field
strValue=false
if avalues.exists("PtLetterMailed") then _
strValue = avalues.Item("PtLetterMailed")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtLetterMailed")
if strValue<>"" and IsNumeric(strValue) then
rs("PtLetterMailed") = CLng(strValue)
else
rs("PtLetterMailed") = null
end if
call report_error
end if
' insert PtLetterMailDate-1 field
strValue=false
if avalues.exists("PtLetterMailDate-1") then _
strValue = avalues.Item("PtLetterMailDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtLetterMailDate_1")
if strValue="" then
rs("PtLetterMailDate-1")=null
else
rs("PtLetterMailDate-1")=strValue
end if
call report_error
end if
' insert PtListSentDate-2 field
strValue=false
if avalues.exists("PtListSentDate-2") then _
strValue = avalues.Item("PtListSentDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListSentDate_2")
if strValue="" then
rs("PtListSentDate-2")=null
else
rs("PtListSentDate-2")=strValue
end if
call report_error
end if
' insert PtListRemindVia-2 field
strValue=false
if avalues.exists("PtListRemindVia-2") then _
strValue = avalues.Item("PtListRemindVia-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindVia_2")
rs("PtListRemindVia-2") = strValue
call report_error
end if
' insert PtListRemindDate-2 field
strValue=false
if avalues.exists("PtListRemindDate-2") then _
strValue = avalues.Item("PtListRemindDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindDate_2")
if strValue="" then
rs("PtListRemindDate-2")=null
else
rs("PtListRemindDate-2")=strValue
end if
call report_error
end if
' insert PtListReturnDate-2 field
strValue=false
if avalues.exists("PtListReturnDate-2") then _
strValue = avalues.Item("PtListReturnDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListReturnDate_2")
if strValue="" then
rs("PtListReturnDate-2")=null
else
rs("PtListReturnDate-2")=strValue
end if
call report_error
end if
' insert PtLetterMailDate-2 field
strValue=false
if avalues.exists("PtLetterMailDate-2") then _
strValue = avalues.Item("PtLetterMailDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtLetterMailDate_2")
if strValue="" then
rs("PtLetterMailDate-2")=null
else
rs("PtLetterMailDate-2")=strValue
end if
call report_error
end if
' insert PtListSentDate-3 field
strValue=false
if avalues.exists("PtListSentDate-3") then _
strValue = avalues.Item("PtListSentDate-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListSentDate_3")
if strValue="" then
rs("PtListSentDate-3")=null
else
rs("PtListSentDate-3")=strValue
end if
call report_error
end if
' insert PtListRemindVia-3 field
strValue=false
if avalues.exists("PtListRemindVia-3") then _
strValue = avalues.Item("PtListRemindVia-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindVia_3")
rs("PtListRemindVia-3") = strValue
call report_error
end if
' insert PtListRemindDate-3 field
strValue=false
if avalues.exists("PtListRemindDate-3") then _
strValue = avalues.Item("PtListRemindDate-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListRemindDate_3")
if strValue="" then
rs("PtListRemindDate-3")=null
else
rs("PtListRemindDate-3")=strValue
end if
call report_error
end if
' insert PtListReturnDate-3 field
strValue=false
if avalues.exists("PtListReturnDate-3") then _
strValue = avalues.Item("PtListReturnDate-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtListReturnDate_3")
if strValue="" then
rs("PtListReturnDate-3")=null
else
rs("PtListReturnDate-3")=strValue
end if
call report_error
end if
' insert PtLetterMailDate-3 field
strValue=false
if avalues.exists("PtLetterMailDate-3") then _
strValue = avalues.Item("PtLetterMailDate-3")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PtLetterMailDate_3")
if strValue="" then
rs("PtLetterMailDate-3")=null
else
rs("PtLetterMailDate-3")=strValue
end if
call report_error
end if
' insert EdocInviteSent field
strValue=false
if avalues.exists("EdocInviteSent") then _
strValue = avalues.Item("EdocInviteSent")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_EdocInviteSent")
if strValue<>"" and IsNumeric(strValue) then
rs("EdocInviteSent") = CLng(strValue)
else
rs("EdocInviteSent") = null
end if
call report_error
end if
' insert EdocInviteDate-1 field
strValue=false
if avalues.exists("EdocInviteDate-1") then _
strValue = avalues.Item("EdocInviteDate-1")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_EdocInviteDate_1")
if strValue="" then
rs("EdocInviteDate-1")=null
else
rs("EdocInviteDate-1")=strValue
end if
call report_error
end if
' insert EdocInviteDate-2 field
strValue=false
if avalues.exists("EdocInviteDate-2") then _
strValue = avalues.Item("EdocInviteDate-2")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_EdocInviteDate_2")
if strValue="" then
rs("EdocInviteDate-2")=null
else
rs("EdocInviteDate-2")=strValue
end if
call report_error
end if
' insert EdocDirectionsSentDate field
strValue=false
if avalues.exists("EdocDirectionsSentDate") then _
strValue = avalues.Item("EdocDirectionsSentDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_EdocDirectionsSentDate")
if strValue="" then
rs("EdocDirectionsSentDate")=null
else
rs("EdocDirectionsSentDate")=strValue
end if
call report_error
end if
' insert PenSent field
strValue=false
if avalues.exists("PenSent") then _
strValue = avalues.Item("PenSent")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PenSent")
if strValue<>"" and IsNumeric(strValue) then
rs("PenSent") = CLng(strValue)
else
rs("PenSent") = null
end if
call report_error
end if
' insert PenSentDate field
strValue=false
if avalues.exists("PenSentDate") then _
strValue = avalues.Item("PenSentDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_PenSentDate")
if strValue="" then
rs("PenSentDate")=null
else
rs("PenSentDate")=strValue
end if
call report_error
end if
' insert Withdrawl field
strValue=false
if avalues.exists("Withdrawl") then _
strValue = avalues.Item("Withdrawl")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Withdrawl")
if strValue<>"" and IsNumeric(strValue) then
rs("Withdrawl") = CLng(strValue)
else
rs("Withdrawl") = null
end if
call report_error
end if
' insert WithdrawlDate field
strValue=false
if avalues.exists("WithdrawlDate") then _
strValue = avalues.Item("WithdrawlDate")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_WithdrawlDate")
if strValue="" then
rs("WithdrawlDate")=null
else
rs("WithdrawlDate")=strValue
end if
call report_error
end if
' insert WithdrawlReason field
strValue=false
if avalues.exists("WithdrawlReason") then _
strValue = avalues.Item("WithdrawlReason")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_WithdrawlReason")
rs("WithdrawlReason") = strValue
call report_error
end if
' insert Notes field
strValue=false
if avalues.exists("Notes") then _
strValue = avalues.Item("Notes")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Notes")
rs("Notes") = strValue
call report_error
end if
' insert ClinicID field
strValue=false
if avalues.exists("ClinicID") then _
strValue = avalues.Item("ClinicID")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_ClinicID")
rs("ClinicID") = strValue
call report_error
end if
' insert SPID field
strValue=false
if avalues.exists("SPID") then _
strValue = avalues.Item("SPID")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_SPID")
if strValue<>"" and IsNumeric(strValue) then
rs("SPID") = CLng(strValue)
else
rs("SPID") = null
end if
call report_error
end if
if not errorhappened then
rs.Update
call report_error
end if
on error goto 0
if not errorhappened then
'// after add event
DoEvent "AfterAdd()"

message="

<<< " & "Record was added" & " >>>
"
end if
else
readavalues=true
end if

end if


set defvalues = CreateObject("Scripting.Dictionary")
set keys = CreateObject("Scripting.Dictionary")

keys("DoctorID")=postvalue("copyid1")

'// copy record
if getRequestForm("copyid1")<>"" then
sstrWhere=KeyWhere(keys,"")
strSQL=gstrSQL
strSQL=AddWhere(strSQL,sstrWhere)
LogInfo(strSQL)
rs.open strSQL,dbConnection, 1, 2
if not rs.EOF then
defvalues("LastName")=dbvalue(rs("LastName"))
defvalues("FirstName")=dbvalue(rs("FirstName"))
defvalues("Phone")=dbvalue(rs("Phone"))
defvalues("Email")=dbvalue(rs("Email"))
defvalues("Specialty")=dbvalue(rs("Specialty"))
defvalues("WaitingRoom")=dbvalue(rs("WaitingRoom"))
defvalues("ConsentSent")=dbvalue(rs("ConsentSent"))
defvalues("ConsentSentVia-1")=dbvalue(rs("ConsentSentVia-1") )
defvalues("ConsentSentDate-1")=dbvalue(rs("ConsentSentDate-1 "))
defvalues("ConsentSent2")=dbvalue(rs("ConsentSent2"))
defvalues("ConsentSentVia-2")=dbvalue(rs("ConsentSentVia-2") )
defvalues("ConsentSentDate-2")=dbvalue(rs("ConsentSentDate-2 "))
defvalues("ConsentSent3")=dbvalue(rs("ConsentSent3"))
defvalues("ConsentSentVia-3")=dbvalue(rs("ConsentSentVia-3") )
defvalues("ConsentSentDate-3")=dbvalue(rs("ConsentSentDate-3 "))
defvalues("ConsentReturned")=dbvalue(rs("ConsentReturned"))
defvalues("ConsentReturnedVia")=dbvalue(rs("ConsentReturnedV ia"))
defvalues("ConsentReturnedDate")=dbvalue(rs("ConsentReturned Date"))
defvalues("QaireEmailed")=dbvalue(rs("QaireEmailed"))
defvalues("QaireEmailDate")=dbvalue(rs("QaireEmailDate"))
defvalues("QaireEmailed2")=dbvalue(rs("QaireEmailed2"))
defvalues("QaireEmailDate2")=dbvalue(rs("QaireEmailDate2"))
defvalues("QaireCompleted")=dbvalue(rs("QaireCompleted"))
defvalues("QaireCompleteDate")=dbvalue(rs("QaireCompleteDate "))
defvalues("PtListPulled1")=dbvalue(rs("PtListPulled1"))
defvalues("PtListN-1")=dbvalue(rs("PtListN-1"))
defvalues("PtListSent")=dbvalue(rs("PtListSent"))
defvalues("PtListSentDate-1")=dbvalue(rs("PtListSentDate-1") )
defvalues("PtListRemindSent")=dbvalue(rs("PtListRemindSent") )
defvalues("PtListRemindVia")=dbvalue(rs("PtListRemindVia"))
defvalues("PtListRemindDate-1")=dbvalue(rs("PtListRemindDate -1"))
defvalues("PtListReturned")=dbvalue(rs("PtListReturned"))
defvalues("PtListReturnDate-1")=dbvalue(rs("PtListReturnDate -1"))
defvalues("PtLetterMailed")=dbvalue(rs("PtLetterMailed"))
defvalues("PtLetterMailDate-1")=dbvalue(rs("PtLetterMailDate -1"))
defvalues("PtListSentDate-2")=dbvalue(rs("PtListSentDate-2") )
defvalues("PtListRemindVia-2")=dbvalue(rs("PtListRemindVia-2 "))
defvalues("PtListRemindDate-2")=dbvalue(rs("PtListRemindDate -2"))
defvalues("PtListReturnDate-2")=dbvalue(rs("PtListReturnDate -2"))
defvalues("PtLetterMailDate-2")=dbvalue(rs("PtLetterMailDate -2"))
defvalues("PtListSentDate-3")=dbvalue(rs("PtListSentDate-3") )
defvalues("PtListRemindVia-3")=dbvalue(rs("PtListRemindVia-3 "))
defvalues("PtListRemindDate-3")=dbvalue(rs("PtListRemindDate -3"))
defvalues("PtListReturnDate-3")=dbvalue(rs("PtListReturnDate -3"))
defvalues("PtLetterMailDate-3")=dbvalue(rs("PtLetterMailDate -3"))
defvalues("EdocInviteSent")=dbvalue(rs("EdocInviteSent"))
defvalues("EdocInviteDate-1")=dbvalue(rs("EdocInviteDate-1") )
defvalues("EdocInviteDate-2")=dbvalue(rs("EdocInviteDate-2") )
defvalues("EdocDirectionsSentDate")=dbvalue(rs("EdocDirectio nsSentDate"))
defvalues("PenSent")=dbvalue(rs("PenSent"))
defvalues("PenSentDate")=dbvalue(rs("PenSentDate"))
defvalues("Withdrawl")=dbvalue(rs("Withdrawl"))
defvalues("WithdrawlDate")=dbvalue(rs("WithdrawlDate"))
defvalues("WithdrawlReason")=dbvalue(rs("WithdrawlReason"))
defvalues("Notes")=dbvalue(rs("Notes"))
defvalues("ClinicID")=dbvalue(rs("ClinicID"))
defvalues("SPID")=dbvalue(rs("SPID"))
end if
'// clear key fields
defvalues("DoctorID")=""
'//call CopyOnLoad event
DoEvent "Call CopyOnLoad(defvalues,sstrWhere)"
else
defvalues("ConsentSentVia-1")="email"
defvalues("ConsentSentDate-1")="N/A"
defvalues("ConsentSentVia-2")="email"
defvalues("ConsentSentDate-2")="N/A"
defvalues("ConsentSentVia-3")="email"
defvalues("ConsentSentDate-3")="N/A"
defvalues("ConsentReturnedDate")="N/A"
defvalues("QaireEmailDate")="N/A"
defvalues("QaireEmailDate2")="N/A"
defvalues("QaireCompleteDate")="N/A"
defvalues("PtListSentDate-1")="N/A"
defvalues("PtListReturnDate-1")="N/A"
defvalues("PtLetterMailDate-1")="N/A"
defvalues("PtListSentDate-2")="N/A"
defvalues("PtListReturnDate-2")="N/A"
defvalues("EdocInviteDate-1")="N/A"
defvalues("EdocInviteDate-2")="N/A"
defvalues("EdocDirectionsSentDate")="N/A"
defvalues("PenSentDate")="N/A"
defvalues("WithdrawlDate")="N/A"
end if

' save previously enterd values
if readavalues then
if avalues.exists("LastName") then
defvalues("LastName")= avalues("LastName")
end if
if avalues.exists("FirstName") then
defvalues("FirstName")= avalues("FirstName")
end if
if avalues.exists("Phone") then
defvalues("Phone")= avalues("Phone")
end if
if avalues.exists("Email") then
defvalues("Email")= avalues("Email")
end if
if avalues.exists("Specialty") then
defvalues("Specialty")= avalues("Specialty")
end if
if avalues.exists("WaitingRoom") then
defvalues("WaitingRoom")= avalues("WaitingRoom")
end if
if avalues.exists("ConsentSent") then
defvalues("ConsentSent")= avalues("ConsentSent")
end if
if avalues.exists("ConsentSentVia-1") then
defvalues("ConsentSentVia-1")= avalues("ConsentSentVia-1")
end if
if avalues.exists("ConsentSentDate-1") then
defvalues("ConsentSentDate-1")= avalues("ConsentSentDate-1")
end if
if avalues.exists("ConsentSent2") then
defvalues("ConsentSent2")= avalues("ConsentSent2")
end if
if avalues.exists("ConsentSentVia-2") then
defvalues("ConsentSentVia-2")= avalues("ConsentSentVia-2")
end if
if avalues.exists("ConsentSentDate-2") then
defvalues("ConsentSentDate-2")= avalues("ConsentSentDate-2")
end if
if avalues.exists("ConsentSent3") then
defvalues("ConsentSent3")= avalues("ConsentSent3")
end if
if avalues.exists("ConsentSentVia-3") then
defvalues("ConsentSentVia-3")= avalues("ConsentSentVia-3")
end if
if avalues.exists("ConsentSentDate-3") then
defvalues("ConsentSentDate-3")= avalues("ConsentSentDate-3")
end if
if avalues.exists("ConsentReturned") then
defvalues("ConsentReturned")= avalues("ConsentReturned")
end if
if avalues.exists("ConsentReturnedVia") then
defvalues("ConsentReturnedVia")= avalues("ConsentReturnedVia")
end if
if avalues.exists("ConsentReturnedDate") then
defvalues("ConsentReturnedDate")= avalues("ConsentReturnedDate")
end if
if avalues.exists("QaireEmailed") then
defvalues("QaireEmailed")= avalues("QaireEmailed")
end if
if avalues.exists("QaireEmailDate") then
defvalues("QaireEmailDate")= avalues("QaireEmailDate")
end if
if avalues.exists("QaireEmailed2") then
defvalues("QaireEmailed2")= avalues("QaireEmailed2")
end if
if avalues.exists("QaireEmailDate2") then
defvalues("QaireEmailDate2")= avalues("QaireEmailDate2")
end if
if avalues.exists("QaireCompleted") then
defvalues("QaireCompleted")= avalues("QaireCompleted")
end if
if avalues.exists("QaireCompleteDate") then
defvalues("QaireCompleteDate")= avalues("QaireCompleteDate")
end if
if avalues.exists("PtListPulled1") then
defvalues("PtListPulled1")= avalues("PtListPulled1")
end if
if avalues.exists("PtListN-1") then
defvalues("PtListN-1")= avalues("PtListN-1")
end if
if avalues.exists("PtListSent") then
defvalues("PtListSent")= avalues("PtListSent")
end if
if avalues.exists("PtListSentDate-1") then
defvalues("PtListSentDate-1")= avalues("PtListSentDate-1")
end if
if avalues.exists("PtListRemindSent") then
defvalues("PtListRemindSent")= avalues("PtListRemindSent")
end if
if avalues.exists("PtListRemindVia") then
defvalues("PtListRemindVia")= avalues("PtListRemindVia")
end if
if avalues.exists("PtListRemindDate-1") then
defvalues("PtListRemindDate-1")= avalues("PtListRemindDate-1")
end if
if avalues.exists("PtListReturned") then
defvalues("PtListReturned")= avalues("PtListReturned")
end if
if avalues.exists("PtListReturnDate-1") then
defvalues("PtListReturnDate-1")= avalues("PtListReturnDate-1")
end if
if avalues.exists("PtLetterMailed") then
defvalues("PtLetterMailed")= avalues("PtLetterMailed")
end if
if avalues.exists("PtLetterMailDate-1") then
defvalues("PtLetterMailDate-1")= avalues("PtLetterMailDate-1")
end if
if avalues.exists("PtListSentDate-2") then
defvalues("PtListSentDate-2")= avalues("PtListSentDate-2")
end if
if avalues.exists("PtListRemindVia-2") then
defvalues("PtListRemindVia-2")= avalues("PtListRemindVia-2")
end if
if avalues.exists("PtListRemindDate-2") then
defvalues("PtListRemindDate-2")= avalues("PtListRemindDate-2")
end if
if avalues.exists("PtListReturnDate-2") then
defvalues("PtListReturnDate-2")= avalues("PtListReturnDate-2")
end if
if avalues.exists("PtLetterMailDate-2") then
defvalues("PtLetterMailDate-2")= avalues("PtLetterMailDate-2")
end if
if avalues.exists("PtListSentDate-3") then
defvalues("PtListSentDate-3")= avalues("PtListSentDate-3")
end if
if avalues.exists("PtListRemindVia-3") then
defvalues("PtListRemindVia-3")= avalues("PtListRemindVia-3")
end if
if avalues.exists("PtListRemindDate-3") then
defvalues("PtListRemindDate-3")= avalues("PtListRemindDate-3")
end if
if avalues.exists("PtListReturnDate-3") then
defvalues("PtListReturnDate-3")= avalues("PtListReturnDate-3")
end if
if avalues.exists("PtLetterMailDate-3") then
defvalues("PtLetterMailDate-3")= avalues("PtLetterMailDate-3")
end if
if avalues.exists("EdocInviteSent") then
defvalues("EdocInviteSent")= avalues("EdocInviteSent")
end if
if avalues.exists("EdocInviteDate-1") then
defvalues("EdocInviteDate-1")= avalues("EdocInviteDate-1")
end if
if avalues.exists("EdocInviteDate-2") then
defvalues("EdocInviteDate-2")= avalues("EdocInviteDate-2")
end if
if avalues.exists("EdocDirectionsSentDate") then
defvalues("EdocDirectionsSentDate")= avalues("EdocDirectionsSentDate")
end if
if avalues.exists("PenSent") then
defvalues("PenSent")= avalues("PenSent")
end if
if avalues.exists("PenSentDate") then
defvalues("PenSentDate")= avalues("PenSentDate")
end if
if avalues.exists("Withdrawl") then
defvalues("Withdrawl")= avalues("Withdrawl")
end if
if avalues.exists("WithdrawlDate") then
defvalues("WithdrawlDate")= avalues("WithdrawlDate")
end if
if avalues.exists("WithdrawlReason") then
defvalues("WithdrawlReason")= avalues("WithdrawlReason")
end if
if avalues.exists("Notes") then
defvalues("Notes")= avalues("Notes")
end if
if avalues.exists("ClinicID") then
defvalues("ClinicID")= avalues("ClinicID")
end if
if avalues.exists("SPID") then
defvalues("SPID")= avalues("SPID")
end if
end if

for each key in defvalues
smarty.Add "value_" & GoodFieldName(key),defvalues(key)
next


'// include files

includes=""

'// validation stuff
bodyonload=""
onsubmit=""
includes=includes & " "
includes=includes & " "
validatetype=""
if validatetype<>"" then bodyonload=bodyonload & "define('value_SPID','" &
validatetype & "','SPID');"

if bodyonload<>"" then
onsubmit="return validate();"
bodyonload="onload=""" & bodyonload & """"
end if

if useAJAX then
includes=includes & "" & vbcrlf
includes=includes & "" & vbcrlf
end if
includes=includes & " " & vbcrlf
includes=includes & " " & vbcrlf
if useAJAX then
includes=includes & "
" & vbcrlf
end if

'// include datepicker files
includes=includes & " "







smarty.Add "includes",includes
smarty.Add "bodyonload",bodyonload
if len(onsubmit)>0 then onsubmit="onSubmit=""" & onsubmit & """"
smarty.Add "onsubmit",onsubmit

smarty.Add "message",message


max_filesize_set=0

set readonlyfields = CreateObject("Scripting.Dictionary")

'// show readonly fields

linkdata=""

if useAJAX then
linkdata = linkdata & "" & vbCrLf
else
end if

smarty.Add "linkdata",linkdata


templatefile = "Doctors_add.htm"
DoEvent "BeforeShowAdd smarty,templatefile"
smarty_display(templatefile)

function report_error
if Err.number<>0 then
message = "
<<< " & "Record was NOT added" & "
>>>

" & Err.Description & "
"
readavalues=true
errorhappened=true
err.clear
end if
end function
%>


McKirahan wrote:
>> Here is the area of html around the save button (plus some more)...where
>> would i put the part you gave me into this? Thanks so much again!!!
>[quoted text clipped - 15 lines]
>> {include_if_exists file="include/footer.asp"} {
>> $linkdata}
>
>Where's your ASP code?

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 12.10.2007 15:00:51 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:798f55780afd8@uwe...
> Sorry about that, here is the asp for that "Add doctor" page: Thank you
again!

[snip 2400+ lines!]

> McKirahan wrote:
> >> Here is the area of html around the save button (plus some
more)...where
> >> would i put the part you gave me into this? Thanks so much again!!!
> >
> >Where's your ASP code?

Insert the Function Email() after your ASP code but within <% and %>.

After you save the Doctor then call the "Email()" function as I
showed you in the Response.Write() statement; for example:

If Email("news@mckirahan.com","Test","Test!")) Then
' success
Else
' failure
End If

How do you save the Doctor?
I don't see any database code.
What database are you using?
Is the code within an "include"?

Re: Generate email when I click button?

am 12.10.2007 17:53:52 von u37541

Is this what you mean? Thanks so much by the way.


SPID



{build_edit_control field="SPID" mode="add" value=
$value_SPID}

colSpan=2>

value="added">





- Required field

{include_if_exists file="include/footer.asp"} {
$linkdata}


McKirahan wrote:
>> Sorry about that, here is the asp for that "Add doctor" page: Thank you again!
>
>[snip 2400+ lines!]
>
>> >> Here is the area of html around the save button (plus some more)...where
>> >> would i put the part you gave me into this? Thanks so much again!!!
>> >
>> >Where's your ASP code?
>
>Insert the Function Email() after your ASP code but within <% and %>.
>
>After you save the Doctor then call the "Email()" function as I
>showed you in the Response.Write() statement; for example:
>
>If Email("news@mckirahan.com","Test","Test!")) Then
>' success
>Else
>' failure
>End If
>
>How do you save the Doctor?
>I don't see any database code.
>What database are you using?
>Is the code within an "include"?

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 12.10.2007 21:22:52 von u37541

McKirahan, would it be possible to email you directly?

McKirahan wrote:
>> Sorry about that, here is the asp for that "Add doctor" page: Thank you again!
>
>[snip 2400+ lines!]
>
>> >> Here is the area of html around the save button (plus some more)...where
>> >> would i put the part you gave me into this? Thanks so much again!!!
>> >
>> >Where's your ASP code?
>
>Insert the Function Email() after your ASP code but within <% and %>.
>
>After you save the Doctor then call the "Email()" function as I
>showed you in the Response.Write() statement; for example:
>
>If Email("news@mckirahan.com","Test","Test!")) Then
>' success
>Else
>' failure
>End If
>
>How do you save the Doctor?
>I don't see any database code.
>What database are you using?
>Is the code within an "include"?

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 13.10.2007 00:55:21 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:799624a4718c6@uwe...
> Is this what you mean? Thanks so much by the way.

[snip]

No.

Re: Generate email when I click button?

am 13.10.2007 00:55:23 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:7997f7b5ea12a@uwe...
> McKirahan, would it be possible to email you directly?

[snip]

Let's keep it in the newsgroup so others may benefit.

Re: Generate email when I click button?

am 13.10.2007 01:48:40 von u37541

Thanks for trying to help, but it doesn't seem like anybody knows how to do
this when it comes down to it. I do sincerely appreciate your help though.

Tim

McKirahan wrote:
>> McKirahan, would it be possible to email you directly?
>
>[snip]
>
>Let's keep it in the newsgroup so others may benefit.

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 13.10.2007 01:48:51 von u37541

And what do you mean by "snip"?

majahops wrote:
>Thanks for trying to help, but it doesn't seem like anybody knows how to do
>this when it comes down to it. I do sincerely appreciate your help though.
>
>Tim
>
>>> McKirahan, would it be possible to email you directly?
>>
>>[snip]
>>
>>Let's keep it in the newsgroup so others may benefit.

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 13.10.2007 05:08:43 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:799a4a59b76cd@uwe...
> And what do you mean by "snip"?

"[snip]" indicates that lines were removed from a previous post
to avoid clutter; that is, to keep the size of the message down
as well as to allow the most relevant points to be readable

> majahops wrote:
> >Thanks for trying to help, but it doesn't seem like anybody knows how to
do
> >this when it comes down to it. I do sincerely appreciate your help
though.

The "anybody" you refer to is evidently me and I do know how to
sedn email from within ASP using GoDaddy.

You haven't answered my questions about how use use ASP to
save a new Doctor so the task of helping you is difficult.

Good luck.

> >>> McKirahan, would it be possible to email you directly?
> >>
> >>[snip]
> >>
> >>Let's keep it in the newsgroup so others may benefit.

Re: Generate email when I click button?

am 13.10.2007 05:10:15 von u37541

I didn't mean to be rude, im just desperate. Can I attach/send all of my asp
and aspx files relating to this so you can see? Im sure you'll know which one
it is within a few seconds.

It'd mean a lot. thanks

Tim

McKirahan wrote:
>> And what do you mean by "snip"?
>
>"[snip]" indicates that lines were removed from a previous post
>to avoid clutter; that is, to keep the size of the message down
>as well as to allow the most relevant points to be readable
>
>> >Thanks for trying to help, but it doesn't seem like anybody knows how to do
>> >this when it comes down to it. I do sincerely appreciate your help though.
>
>The "anybody" you refer to is evidently me and I do know how to
>sedn email from within ASP using GoDaddy.
>
>You haven't answered my questions about how use use ASP to
>save a new Doctor so the task of helping you is difficult.
>
>Good luck.
>
>> >>> McKirahan, would it be possible to email you directly?
>> >>
>> >>[snip]
>> >>
>> >>Let's keep it in the newsgroup so others may benefit.

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 13.10.2007 16:40:54 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:799c0c90ad6f3@uwe...
> I didn't mean to be rude, im just desperate. Can I attach/send all of my
asp
> and aspx files relating to this so you can see? Im sure you'll know which
one
> it is within a few seconds.
>
> It'd mean a lot. thanks

[snip]

Is your site using ASP (.asp) or ASP.NET (.aspx) pages?

Don't send them! If you are a developer then you should be
able to figure out where my function goes and how it works.

If you're not a developer what are you doing maintaining code!

Re: Generate email when I click button?

am 13.10.2007 19:13:02 von u37541

ASP.NET. Why, is this the wrong place for that?

McKirahan wrote:
>> I didn't mean to be rude, im just desperate. Can I attach/send all of my asp
>> and aspx files relating to this so you can see? Im sure you'll know which one
>> it is within a few seconds.
>>
>> It'd mean a lot. thanks
>
>[snip]
>
>Is your site using ASP (.asp) or ASP.NET (.aspx) pages?
>
>Don't send them! If you are a developer then you should be
>able to figure out where my function goes and how it works.
>
>If you're not a developer what are you doing maintaining code!

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 13.10.2007 20:23:23 von u37541

Look McKirahan,

First off, no I am not a developer. I am a clinical oncologist (cancer MD)
who is part of a small group of physicians that are trying to organize a
volunteer physician-based program that will offer free screening to the
uninsured and underinsured populations of california for prostate, breast and
other reproductive cancers.

I volunteered to work on the website (in retrospect, probably a bad idea, but
I promised I would and I need to make good on it). A program called ASPRunner
Pro was EXTREMELY useful in helping me get the basic database-layout down,
but the feature of having automatic email's sent to doctor's when I add them
to the database would be so extremely useful for us that I cannot begin to
explain.

I wish I had more time in the day to learn this language - and I have tried -
but I just never am able find out how to execute this one task.

When you first replied, you were like a godsend to us because you were going
to - in the long run - save us an extraordinary amount of time, just by
taking a few minutes to tell me how to do this one thing.

However, clearly, my profound ignorance in this area has frustrated you and
tested your patience. That is why I am begging of you, if there is anyway you
can just tell me what it is you need to see (exactly) - to help us implement
this one feature - you would be making a huge difference across the board.

Im sorry for wasting so much of your time, I truly am.


majahops wrote:
>ASP.NET. Why, is this the wrong place for that?
>
>>> I didn't mean to be rude, im just desperate. Can I attach/send all of my asp
>>> and aspx files relating to this so you can see? Im sure you'll know which one
>[quoted text clipped - 10 lines]
>>
>>If you're not a developer what are you doing maintaining code!

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 14.10.2007 01:56:17 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:79a3686c391d5@uwe...
> ASP.NET. Why, is this the wrong place for that?

[snip]

Yes, this is a Classic ASP newsgroup.

The code I provided you before was for Classic ASP
not ASP.NET; you'll likely need something else.

Perhaps you should try this newsgroup:
microsoft.public.dotnet.framework.aspnet

Re: Generate email when I click button?

am 14.10.2007 12:03:45 von Anthony Jones

"majahops via WebmasterKB.com" wrote in message
news:798bc3f05f9b3@uwe...
> When I click "save" after adding a new record (which contains, among other
> fields, the person's email address), I want an email to automatically be
sent
> to that person (at the email that is in the field of that record). How can
I
> do this?
>
> Thanks so much, it really means so much to me!!!
>

One of the most difficult things to do is help a non-developer tweak ASP
code that has been auto-generated by some tool such as ASPRunner, Frontpage
or Dreamweaver.

We like to be able to get a clear picture of what is going on by reviewing
the code but auto-generated code is very, very difficult to follow.

Unfortunately I think that unless the tool you are using provides a means of
injecting your own code into the page any guess we come up with (and it will
be a guess) will fail or work for awhile and then when you tweak the page
the newly generated code will trash the changes made.

Have you got an email account through which to send these emails?

There is a line in your posted ASP (further down in the first branch of this
thread) that looks like:-

DoEvent "AfterAdd()"

My _guess_ is that its after this line you want to call a function to send
an email.
I recommend that you place the email function in a separate asp file.



--
Anthony Jones - MVP ASP/ASP.NET

Re: Generate email when I click button?

am 15.10.2007 02:23:03 von u37541

Anthony,

Thank you. It turns out I am in fact using ASP, not ASP.NET. So, I call a
function, okay, awesome, but how do I set up my mail smtp server (which will
be gmail) and other info, and do I need to "call" that?

Anthony Jones wrote:
>> When I click "save" after adding a new record (which contains, among other
>> fields, the person's email address), I want an email to automatically be sent
>> to that person (at the email that is in the field of that record). How can I
>> do this?
>>
>> Thanks so much, it really means so much to me!!!
>
>One of the most difficult things to do is help a non-developer tweak ASP
>code that has been auto-generated by some tool such as ASPRunner, Frontpage
>or Dreamweaver.
>
>We like to be able to get a clear picture of what is going on by reviewing
>the code but auto-generated code is very, very difficult to follow.
>
>Unfortunately I think that unless the tool you are using provides a means of
>injecting your own code into the page any guess we come up with (and it will
>be a guess) will fail or work for awhile and then when you tweak the page
>the newly generated code will trash the changes made.
>
>Have you got an email account through which to send these emails?
>
>There is a line in your posted ASP (further down in the first branch of this
>thread) that looks like:-
>
>DoEvent "AfterAdd()"
>
>My _guess_ is that its after this line you want to call a function to send
>an email.
>I recommend that you place the email function in a separate asp file.
>

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 15.10.2007 04:23:52 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:79b3bc160c577@uwe...
> Anthony,
>
> Thank you. It turns out I am in fact using ASP, not ASP.NET. So, I call a
> function, okay, awesome, but how do I set up my mail smtp server (which
will
> be gmail) and other info, and do I need to "call" that?

[snip]

You don't need to set up an SMTP server if you are using GoDaddy for
hosting.

Save the script I posted as "Email.asp" and test it as-is.

Re: Generate email when I click button?

am 15.10.2007 05:40:16 von u37541

Awesome. How do I link it to the email address that I created in the record
though? Thanks again!!!

McKirahan wrote:
>> Anthony,
>>
>> Thank you. It turns out I am in fact using ASP, not ASP.NET. So, I call a
>> function, okay, awesome, but how do I set up my mail smtp server (which will
>> be gmail) and other info, and do I need to "call" that?
>
>[snip]
>
>You don't need to set up an SMTP server if you are using GoDaddy for
>hosting.
>
>Save the script I posted as "Email.asp" and test it as-is.

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 15.10.2007 06:05:48 von u37541

*** I TRIED YOUR SCRIPT AS IS AND IT WORKED, IT SENT AN EMAIL TO ME, WHEN I
CHANGED THE TO: EMAIL FROM YOURS TO MINE!!! ***

Now all I need to know is how to make it send an email to the email address I
add for a doctor when I add them to the database and click "save".

The name of the email field is "email"... as you can see from the following
little shot of code in the doctors_add.asp page:

insert Email field
strValue=false
if avalues.exists("Email") then _
strValue = avalues.Item("Email")
if not errorhappened and not (vartype(strValue)=11 and strValue=False) then
if isnull(strValue) then strValue=""
ctype = GetRequestForm("type_Email")
rs("Email") = strValue

.... So how do I use the value for "email" to send an email to when I click
on save, the relevant code for which is shown below - from an html file
called Doctors_add.html:

class=button id=submit1 type=submit value=Save name=submit1>
value="added">

This is the part about the adding of the record in the original ASP:
'// after add event
DoEvent "AfterAdd()"
message="

<<< " & "Record was added" & " >>>
"
end if
else
readavalues=true
end if
... im guess I put the command for it to "call" email.asp based on a record
somewhere here, but have no idea how to?

majahops wrote:
>Awesome. How do I link it to the email address that I created in the record
>though? Thanks again!!!
>
>>> Anthony,
>>>
>[quoted text clipped - 8 lines]
>>
>>Save the script I posted as "Email.asp" and test it as-is.

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 15.10.2007 14:33:25 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:79b5adcd1e5fe@uwe...
> *** I TRIED YOUR SCRIPT AS IS AND IT WORKED, IT SENT AN EMAIL TO ME, WHEN
I
> CHANGED THE TO: EMAIL FROM YOURS TO MINE!!! ***
>
> Now all I need to know is how to make it send an email to the email
address I
> add for a doctor when I add them to the database and click "save".
>
> The name of the email field is "email"... as you can see from the
following
> little shot of code in the doctors_add.asp page:
>
> insert Email field
> strValue=false
> if avalues.exists("Email") then _
> strValue = avalues.Item("Email")
> if not errorhappened and not (vartype(strValue)=11 and strValue=False)
then
> if isnull(strValue) then strValue=""
> ctype = GetRequestForm("type_Email")
> rs("Email") = strValue
>
> ... So how do I use the value for "email" to send an email to when I click
> on save, the relevant code for which is shown below - from an html file
> called Doctors_add.html:
>
> colSpan=2> > class=button id=submit1 type=submit value=Save name=submit1>
> > value="added">
>
> This is the part about the adding of the record in the original ASP:
> '// after add event
> DoEvent "AfterAdd()"
> message="

<<< " & "Record was added" & " >>>
"
> end if
> else
> readavalues=true
> end if
> .. im guess I put the command for it to "call" email.asp based on a record
> somewhere here, but have no idea how to?
>
> majahops wrote:
> >Awesome. How do I link it to the email address that I created in the
record
> >though? Thanks again!!!

[snip]

Within the ASP code (which is between <% and %>) what is the
name of the variable that stores the retrieved input value from the form?
Whatever it is just substitute it for the variable name "address" below.

<%
If Email(address,"your subject","your message")) Then
' success
Else
' failure
End If
%>

If it is "Email" the you should change the name of the function from
"Email()" to (perhaps) "Send_Email()" so the names won't conflict.

<%
If Send_Email(Email,"your subject","your message")) Then
' success
Else
' failure
End If
%>

Insert the above after you have successfully added a Doctor record.

You may also want to ensure that the email address is correctly
formatted before sending the email otherwise it will "bounce".

Re: Generate email when I click button?

am 16.10.2007 21:52:07 von jp2code

Hey majahops,

Why didn't you say you were using GoDaddy? I've created 3 different email
forms on 3 different sites using GoDaddy.

The text will go before your tag in your web page. Remember to name
it with the ".asp" extension - not a ".htm" or ".html" extension!

The code before the tag will be read by the server, and will not
appear in the Client's browser when he views the source for your page.

I'll be happy to email you an example, if you'd like. Just shoot me an email
using my contact form on my crappy website:
http://www.joeswelding.biz/
It needs a re-design to make it less bandwidth intensive, but I am getting
lots of experience with Classic ASP on parts of it.

"majahops via WebmasterKB.com" wrote:
> McKirahan,
>
> Before I do this, where do I put all of this text? That has been one of
> the
> things that is unclear to me. Do I put it next to the like where the save-
> button is in the html, or what? Thanks so much again!
>

Re: Generate email when I click button?

am 17.10.2007 05:44:57 von u37541

Joe, thanks so much! The only question I have really is how do I call the
specific email that I have in the persons record that I am clicking save for?


Thanks again.

jp2code wrote:
>Hey majahops,
>
>Why didn't you say you were using GoDaddy? I've created 3 different email
>forms on 3 different sites using GoDaddy.
>
>The text will go before your tag in your web page. Remember to name
>it with the ".asp" extension - not a ".htm" or ".html" extension!
>
>The code before the tag will be read by the server, and will not
>appear in the Client's browser when he views the source for your page.
>
>I'll be happy to email you an example, if you'd like. Just shoot me an email
>using my contact form on my crappy website:
>http://www.joeswelding.biz/
>It needs a re-design to make it less bandwidth intensive, but I am getting
>lots of experience with Classic ASP on parts of it.
>
>> McKirahan,
>>
>> Before I do this, where do I put all of this text? That has been one of
>> the
>> things that is unclear to me. Do I put it next to the like where the save-
>> button is in the html, or what? Thanks so much again!

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 17.10.2007 05:46:08 von u37541

Thanks a bunch McKirahan, I will try it right now. Just got back from a trip
to Sacramento. Sucks.



McKirahan wrote:
>> *** I TRIED YOUR SCRIPT AS IS AND IT WORKED, IT SENT AN EMAIL TO ME, WHEN I
>> CHANGED THE TO: EMAIL FROM YOURS TO MINE!!! ***
>[quoted text clipped - 36 lines]
>> >Awesome. How do I link it to the email address that I created in the record
>> >though? Thanks again!!!
>
>[snip]
>
>Within the ASP code (which is between <% and %>) what is the
>name of the variable that stores the retrieved input value from the form?
>Whatever it is just substitute it for the variable name "address" below.
>
><%
>If Email(address,"your subject","your message")) Then
>' success
>Else
>' failure
>End If
>%>
>
>If it is "Email" the you should change the name of the function from
>"Email()" to (perhaps) "Send_Email()" so the names won't conflict.
>
><%
>If Send_Email(Email,"your subject","your message")) Then
>' success
>Else
>' failure
>End If
>%>
>
>Insert the above after you have successfully added a Doctor record.
>
>You may also want to ensure that the email address is correctly
>formatted before sending the email otherwise it will "bounce".

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 17.10.2007 06:05:28 von u37541

So when I put in the code, I get the following message when I try to save the
record:

Error number 3749
Error description Fields update failed. For further information, examine the
Status property of individual field objects.

...

Here is my code (i renamed the function to "mail")

function mail
If mail(email,"your subject","your message")then
' success
Else
' failure
End If
end function

McKirahan wrote:
>> *** I TRIED YOUR SCRIPT AS IS AND IT WORKED, IT SENT AN EMAIL TO ME, WHEN I
>> CHANGED THE TO: EMAIL FROM YOURS TO MINE!!! ***
>[quoted text clipped - 36 lines]
>> >Awesome. How do I link it to the email address that I created in the record
>> >though? Thanks again!!!
>
>[snip]
>
>Within the ASP code (which is between <% and %>) what is the
>name of the variable that stores the retrieved input value from the form?
>Whatever it is just substitute it for the variable name "address" below.
>
><%
>If Email(address,"your subject","your message")) Then
>' success
>Else
>' failure
>End If
>%>
>
>If it is "Email" the you should change the name of the function from
>"Email()" to (perhaps) "Send_Email()" so the names won't conflict.
>
><%
>If Send_Email(Email,"your subject","your message")) Then
>' success
>Else
>' failure
>End If
>%>
>
>Insert the above after you have successfully added a Doctor record.
>
>You may also want to ensure that the email address is correctly
>formatted before sending the email otherwise it will "bounce".

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 17.10.2007 06:06:19 von u37541

... but i put a space between ) and "then" of course

majahops wrote:
>So when I put in the code, I get the following message when I try to save the
>record:
>
>Error number 3749
>Error description Fields update failed. For further information, examine the
>Status property of individual field objects.
>
>...
>
>Here is my code (i renamed the function to "mail")
>
>function mail
>If mail(email,"your subject","your message")then
>' success
>Else
>' failure
>End If
>end function
>
>>> *** I TRIED YOUR SCRIPT AS IS AND IT WORKED, IT SENT AN EMAIL TO ME, WHEN I
>>> CHANGED THE TO: EMAIL FROM YOURS TO MINE!!! ***
>[quoted text clipped - 31 lines]
>>You may also want to ensure that the email address is correctly
>>formatted before sending the email otherwise it will "bounce".

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 17.10.2007 06:37:10 von u37541

Any ideas?

majahops wrote:
>... but i put a space between ) and "then" of course
>
>>So when I put in the code, I get the following message when I try to save the
>>record:
>[quoted text clipped - 20 lines]
>>>You may also want to ensure that the email address is correctly
>>>formatted before sending the email otherwise it will "bounce".

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 17.10.2007 14:31:12 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:79ced47655496@uwe...
> .. but i put a space between ) and "then" of course
>
> majahops wrote:
> >So when I put in the code, I get the following message when I try to save
the
> >record:
> >
> >Error number 3749
> >Error description Fields update failed. For further information, examine
the
> >Status property of individual field objects.
> >
> >...
> >
> >Here is my code (i renamed the function to "mail")
> >
> >function mail
> >If mail(email,"your subject","your message")then
> >' success
> >Else
> >' failure
> >End If
> >end function

[snip]

You're calling the function from within itself!

Why did you put the "If" statement inside of a function?

Look another look at what I gave you before.

Re: Generate email when I click button?

am 17.10.2007 14:40:30 von McKirahan

"McKirahan" wrote in message
news:ZOednS4At8ggnYvanZ2dnUVZ_sSlnZ2d@comcast.com...
> "majahops via WebmasterKB.com" wrote in message
> news:79ced47655496@uwe...
> > .. but i put a space between ) and "then" of course
> >
> > majahops wrote:
> > >So when I put in the code, I get the following message when I try to
save
> the
> > >record:
> > >
> > >Error number 3749
> > >Error description Fields update failed. For further information,
examine
> the
> > >Status property of individual field objects.
> > >
> > >...
> > >
> > >Here is my code (i renamed the function to "mail")
> > >
> > >function mail
> > >If mail(email,"your subject","your message")then
> > >' success
> > >Else
> > >' failure
> > >End If
> > >end function
>
> [snip]
>
> You're calling the function from within itself!
>
> Why did you put the "If" statement inside of a function?
>
> Look another look at what I gave you before.

Take another look at what I gave you before.

Use the function that worked for you before:

Function Email(sAddr,sSubj,sBody)
...
End Function

Re: Generate email when I click button?

am 17.10.2007 18:45:51 von u37541

Oh no, I meant that was the code for CALLING the function.

McKirahan wrote:
>> > .. but i put a space between ) and "then" of course
>> >
>[quoted text clipped - 26 lines]
>>
>> Look another look at what I gave you before.
>
>Take another look at what I gave you before.
>
>Use the function that worked for you before:
>
> Function Email(sAddr,sSubj,sBody)
> ...
> End Function

--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forums.aspx/asp/200710/1

Re: Generate email when I click button?

am 17.10.2007 19:18:22 von u37541

I'm looking at this and I am so lost. Right now I have a file called
Doctors_add.asp, which works well to add a doctors record. The part of this
file with the function in it is below:

Response.Write("send_email = " & send_email("majahops@gemail.com","Test",
"Test!"))

Function send_email(sAddr,sSubj,sBody)
send_email = False
On Error Resume Next
'*
'* Declare Constants
'*
Const cCDO = "http://schemas.microsoft.com/cdo/configuration/"
Const cHST = "relay-hosting.secureserver.net"
Const cFRM = "tbeer@mednet.ucla.edu"
'*
'* Send email
'*
Dim objCFG
Set objCFG = Server.CreateObject("CDO.Configuration")
objCFG.Fields.Item(cCDO & "sendusing") = 2
objCFG.Fields.Item(cCDO & "smtpserver") = cHST
objCFG.Fields.Item(cCDO & "smtpserverport") = 25
objCFG.Fields.Update
Dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")
objCDO.From = cFRM
objCDO.To = sAddr
'objCDO.BCC = ""
'objCDO.CC = ""
objCDO.Subject = sSubj
objCDO.TextBody = sBody
'objCDO.HTMLBody = sBody
'objCDO.AddAttachment = ""
objCDO.Configuration = objCFG
objCDO.Send
' If Err = 0 Then
' Response.Write("

E-email has been sent.")
' Else
' Response.Write("
Sub send_email()")
' Response.Write("
CDO Failed: " & Err.Description)
' Response.Write("
CDO 'Addr': " & sAddr)
' Response.Write("
CDO 'Subj': " & sSubj)
' Response.Write("
CDO 'Body': " & sBody)
' End If
Set objCDO = Nothing
Set objCFG = Nothing
'*
'* Return
'*
On Error GoTo 0
send_email = True
End Function

... but no email is sent when I click save. Any idea?

--
Message posted via http://www.webmasterkb.com

Re: Generate email when I click button?

am 17.10.2007 23:07:47 von McKirahan

"majahops via WebmasterKB.com" wrote in message
news:79d5bea87d8b4@uwe...
> I'm looking at this and I am so lost. Right now I have a file called
> Doctors_add.asp, which works well to add a doctors record. The part of
this
> file with the function in it is below:
>
> Response.Write("send_email = " & send_email("majahops@gemail.com","Test",
> "Test!"))

What does the above line return?

Is it "send_mail = True" or send_mail = False"?

Remove the single quotes from theses lines and see what you get.

' If Err = 0 Then
' Response.Write("

E-email has been sent.")
' Else
' Response.Write("
Sub send_email()")
' Response.Write("
CDO Failed: " & Err.Description)
' Response.Write("
CDO 'Addr': " & sAddr)
' Response.Write("
CDO 'Subj': " & sSubj)
' Response.Write("
CDO 'Body': " & sBody)
' End If