Hi everyone...
I have a problem with getting data out a table, i might have some done wrong, but i don't see it. Just get a simple HTTP 500 Internal Server Error
The same code works perfect in "Before Record Added" function, but not in the "Before Record Update" function.
Only thing i have changed is BeforeAdd = True/False to BeforeEdit = True/False
Also need to compare the OldValue and Value if not the same re-calculate all the dates again, this i have added to the list
I don't see what i have done wrong!
Thanks for any help!
strSQL = "select * from Seeds where SeedID=" & values("SeedID")
Set rsTmp = server.CreateObject("ADODB.Recordset")
rsTmp.open strSQL, dbConnection
If not rsTmp.EOF then
IF CDate(oldvalues("SowingDate")) <> CDate(values("SowingDate")) then
SD = values("SowingDate")
PD = rsTmp("GerminationDays")
POD = rsTmp("PlantOutMonths")
HD = rsTmp("HarvestMonths")
' more values to add for calculation
values("SowingDate") = SD
values("PottingDate") = CDate(DateAdd("d", PD, SD))
values("PlantingOutDate") = CDate(DateAdd("m", POD, SD))
values("HarvestDate") = Cdate(DateAdd("m", HD, SD))
BeforEdit = True
Else
BeforeEdit = False
Response.Write "<script>alert('ERROR: Master table record not found')</script>"
End If
End If
rsTmp.Close : SET rsTmp = Nothing