Hi there.. so I have the following event in one of my tables to send an automatic email based on a few criterias. This even works fine in the Add page but not the edit page.
here is my code in the before edit page
------
Function BeforeEdit(dict, where)
'generate and send automatic email
if dict("Received")="Yes" and dict("EmailSent") = "No" then
message =""
keys = dict.keys
For n = 0 To dict.Count-1
message = message & keys(n) & " : " & dict(keys(n)) & vbcrlf
Next
email="steve@networkcar.com"
subject="New data record TEST TEST"
sendmail email, subject, message
dict("EmailSent")="Yes"
end if
if dict("Shipped")="Yes" and dict("EmailSent2") = "No" then
message =""
keys = dict.keys
For n = 0 To dict.Count-1
message = message & keys(n) & " : " & dict(keys(n)) & vbcrlf
Next
email="steve@networkcar.com"
subject="New data record TEST TEST"
sendmail email, subject, message
dict("EmailSent2")="Yes"
end if
BeforeEdit = True
End Function
-----------------------
So I have EmailSent and EmailSent2 default to "No" in the add page. When I go to the edit page and change
Received and Shipped to Yes I get the following error
-----------------
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
--------------------------------------------------------------------------------
Please try the following:
Click the Refresh button, or try again later.
Open the 168.143.116.20 home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "Rec#"]'
/include/commonfunctions.asp, line 8815
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Page:
POST 6360 bytes to /RAUnitsReturned_edit.asp
POST Data:
error '80020009'
Exception occurred.
/iisHelp/common/500-100.asp, line 223
---------------------------------
The record acutally still updates and the EmailSent fields get changed to "Yes"
Also I did notice that after this error I can go back and edit that record with out receiving this error anymore. It seems to only occur when EmailSent fields are set to No
Any ideas what is casuing this?
Thanks
-Steve